Active Color

Active Color

Anonymous
Not applicable
920 Views
6 Replies
Message 1 of 7

Active Color

Anonymous
Not applicable
Is there anyway to set the Active Color with VBA?

David William Edwards
www.tcfonts.com
0 Likes
921 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
David William Edwards wrote:

> Is there anyway to set the Active Color with VBA?

Something like ...

ThisDrawing.SetVariable "CECOLOR",color

Terry
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thanks! I thought so, but I was looking for something along the
lines of how you make layers active:

ThisDrawing.ActiveLayer = ThisDrawing.Layers(...)

and didn't see one.

David William Edwards

"Terry W. Dotson" wrote in message
news:3D81DD6C.E4A93EFF@dotsoft.com...
> David William Edwards wrote:
>
> > Is there anyway to set the Active Color with VBA?
>
> Something like ...
>
> ThisDrawing.SetVariable "CECOLOR",color
>
> Terry
0 Likes
Message 4 of 7

Anonymous
Not applicable
Ok, then why does this:

Public Sub TestSetColor()
ThisDrawing.SetVariable "CECOLOR", acRed
End Sub

give an error?

David William Edwards


"Terry W. Dotson" wrote in message
news:3D81DD6C.E4A93EFF@dotsoft.com...
> David William Edwards wrote:
>
> > Is there anyway to set the Active Color with VBA?
>
> Something like ...
>
> ThisDrawing.SetVariable "CECOLOR",color
>
> Terry
0 Likes
Message 5 of 7

Anonymous
Not applicable
David William Edwards wrote:

> give an error?

Probably looking for a string to accept "BYLAYER"?

No time to test, just speculating.

Terry
0 Likes
Message 6 of 7

Anonymous
Not applicable
Hi David,

acRed is a numeric constant. The sysvar "cecolor" is expecting a string.

You can do it using "str" if you insist on using the constants.

ThisDrawing.SetVariable "CECOLOR", Str(acRed)

Gary
Message 7 of 7

Anonymous
Not applicable
Thanks, that was it!

David William Edwards

"Gary McMaster" wrote in message
news:C789378DFC90077C48401884C5A4098C@in.WebX.maYIadrTaRb...
> Hi David,
>
> acRed is a numeric constant. The sysvar "cecolor" is expecting a string.
>
> You can do it using "str" if you insist on using the constants.
>
> ThisDrawing.SetVariable "CECOLOR", Str(acRed)
>
> Gary
>
>
0 Likes