Login

View Full Version : Change color of Object to access TrueColor



cgerhardt
2006-12-18, 05:35 PM
AutoCAD 2005.

I see on other posts I should be able to access a .Color property for entities. However I can only access the Truecolor property which always gives me a type mismatch error when I try to set it to acWhite.


Set objBlock = ThisDrawing.Blocks.Item("UMA_SINFO")

For Each objEnt In objBlock
objEnt.TrueColor = acWhite
Next

Can I change the color in the block definition or do I have to point to an actual block reference?

[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]

Ed Jobe
2006-12-18, 06:15 PM
2005 introduced the TrueColor property. The Color property is still there, but depricated. You should use the TrueColor property as the Color property will be discontinued. The Color property takes a constant, which is what acWhite is. However the TrueColor property takes a TrueColor object. See the help files for more information on how to use this object.

shivendrashukla
2006-12-19, 10:39 AM
Hi cgerhardt,

Try this:-


Dim color As AcadAcCmColor
Set color = _
AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
Call color.SetRGB(241, 162, 14)

entity.TrueColor = color

use ur own RGB color values.

Hope this helps
Cheers
Shivendra

[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]