PS:
I should have mentioned that I changed you code to
reflect objects in 'modelspace' as opposed to paperspace and to 'If Typeof objent is acadblockreference then.." but still no go.
-SG
|
PS:
I should have mentioned that I changed you code to
reflect objects in 'modelspace' as opposed to paperspace and to 'If Typeof objent is acadblockreference then.." but still no go.
-SG
Either I'm not sure what you're trying or you're not. Try this. First, see if you can manually change your blocks the way you want using the property pallet. If so, post the file so I can see it. Because when I try it with a block defined on lay 0, changing the block insert's color makes no difference since the def looks at what color the layer is assigned. You may need to redefine your blocks.
Ed: First of all - Thank you for being so patient with me.
I have finally got my code to work the way I wanted it to.
You were right - I had made a mistake while defining the blocks. When I defined them, I had set the color to 'White' instead of 'By Block'. This made all the difference in the subsequent layers.
I also slightly modified your earlier code and got it work seamlessly.
Thank you again for your help.
I might as well ask you another question:
I have used the AcadAcCmColor Class to get the color. Are you aware of potential issues using this class in different versions of ACAD? It seems to crash in 2000. In release 2008, I had to change the code from "Getinfterfaceobject(""AutoCAD.AcCmColor.16") to ....AcCmColor.17
Is there a work around for this?
Thanks
-SG
TrueColor did not come out until AutoCAD 2004. So you cannot use that in earlier releases. As for releases 2004 and above, there is no need to get the interface. You can simply create a new object. In 2002 and earlier, you have to change the Color property. The Color property is depreciated in 2004 and above.
In later versions you can just do this:
Dim myColor as AcadAcCmColor
Set myColor = New AcadAcCmColor
R. Robert Bell
Design Technology Manager
Stantec
Opinions expressed are mine alone and do not reflect the views of Stantec.
Thanks Robert.
Will give that a shot later today.
-SG
Glad you got it working.
In addition to Bob's comments, this nomenclature is the class's signature as listed in the HKEY_CLASSES section of the registry. This is specific to each version of software, so when using GetInterface, you have to use the right string for the version you are using.