How to access the Display color of an Object coming from Partner sofwtare

How to access the Display color of an Object coming from Partner sofwtare

Anonymous
Not applicable
1,501 Views
4 Replies
Message 1 of 5

How to access the Display color of an Object coming from Partner sofwtare

Anonymous
Not applicable

Hello Everyone,

 

How can I access the color an object is being displayed knowing the following:

-The Object comes from ShipConstructor (Autodesk Partner)

- As an "External" entity, it possess TrueColor = byLayer

-The True color of the object after being exploded is the color that is being displayed - This is the Variable and/or Value I am looking for (without having to explode the object)

- The Display color comes from external SQL database

Output Dwgs Display Color diff True Color.pngYour assistance is very much appreciated

0 Likes
Accepted solutions (2)
1,502 Views
4 Replies
Replies (4)
Message 2 of 5

norman.yuan
Mentor
Mentor
Accepted solution

Since you know that after exploding the entity, you get an Acad3DSolid entity, thus is color is available, I guess your question is how to get the color WITHOUT exploding it, right?

 

To me, it looks like the object is a custom entity (not AutoCAD native entity), created via third party's  ObjectARX application. Because you are posting in VBA programming forum, I assume you want to access the custom entity with VBA code.

 

So, the very first question you need to ask is: is this custom entity accessible with AutoCAD COM API/VBA? You need to ask the vendor to confirm this. If not, then you are out of luck. If yes, the vendor's software should comes with COM type library and installed. Then in AutoCAD VBA editor, you can set reference to the type library. After that you can examine its COM API to see if the color property is exposed, or if you can explode the custom entity with code and then get the color value.

 

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5

Anonymous
Not applicable

Hello Norman,
thank you very much for your reply.
1) YES

Since you know that after exploding the entity, you get an Acad3DSolid entity, thus is color is available, I guess your question is how to get the color WITHOUT exploding it, right?

 

2)YES

To me, it looks like the object is a custom entity (not AutoCAD native entity), created via third party's  ObjectARX application. Because you are posting in VBA programming forum, I assume you want to access the custom entity with VBA code.

 

3) YES

So, the very first question you need to ask is: is this custom entity accessible with AutoCAD COM API/VBA? You need to ask the vendor to confirm this. If not, then you are out of luck. If yes, the vendor's software should comes with COM type library and installed. Then in AutoCAD VBA editor, you can set reference to the type library. After that you can examine its COM API to see if the color property is exposed, or if you can explode the custom entity with code and then get the color value.


I know the object can be accessed through VBA. But how do I find which library or module/object governs this property? My reasoning is that, if AutoCad Instance knows which color to show/display, than this value must also be stored somewhere in a acad variable.

 

Thank you in advance for any further clue

BRegards,
JES
 

 

0 Likes
Message 4 of 5

Ed__Jobe
Mentor
Mentor
Accepted solution

@Anonymous wrote:

I know the object can be accessed through VBA. But how do I find which library or module/object governs this property? My reasoning is that, if AutoCad Instance knows which color to show/display, than this value must also be stored somewhere in a acad variable.

 


If it is VBA accessible, you should be able to find something from the vendor in References. In the vbaide, go to Tools>References and look for something with the word "ship" in it. Check the tlb and open the Object Browser to see what objects and properties the api exposes.

As to your reasoning, yes acad stores it "somewhere", but if the vendor didn't supply an api to access it, as Norman said "You're out of luck".

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 5 of 5

Anonymous
Not applicable

Thank you both very much for clarifications.

I have contacted the Vendor for further explanation in how to access that property/value.
Otherwise I will create something as dumb as " copy - Explode - get Color - delete copied object" 
Best Regards

JES  
 

0 Likes