How to add appearance from an assembly to the property of that assembly

How to add appearance from an assembly to the property of that assembly

Charlies_3D_T
Advocate Advocate
378 Views
2 Replies
Message 1 of 3

How to add appearance from an assembly to the property of that assembly

Charlies_3D_T
Advocate
Advocate

Hello,

 

I have a code that adds the appearance from a part to a custom property inside that part: 

 

Dim oDoc As Document
oDoc = ThisDoc.Document
 
If ThisDoc.Document.ActiveAppearance.DisplayName.Contains("RAL") then
 
iProperties.Value("Custom", "Color") = Left(ThisDoc.Document.ActiveAppearance.DisplayName, 8)

End If

 

But this code does not work when i change the color of an assembly inside an assembly. Now i want the following:

 

When i have parts and i make a welding assembly the parts are not colored. But when i place this welding assembly inside an assembly the parts are painted before assembling the wholl set. So i need to welding assembly to be colored inside the final assembly. But i don't know how. Any of you an idea? 

 

0 Likes
379 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

It sounds like you need to use DesignViewRepresentations.  These aren't usually needed within parts, but are available within parts, for cases where you may have a multi-body part, and want to turn visibility of certain bodies off, or want to have multiple part color options set up.  They are much more useful in assemblies though.  Make sure you have an unlocked view representation within the assembly.  Then when you place components into the assembly, make sure that within its representations, the view representation is the right one, and check the box for Associative, so it will automatically update to look the same as the source document.  Then when you place this assembly into another assembly, check its representation the same way, to make sure it the right one, and that it is associative (if wanted).

Then all levels of parts and sub-assemblies will look exactly how you want them to look.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

Charlies_3D_T
Advocate
Advocate

There is no option that when inside an assembly i have other assemblies and when i change the color of one assembly an ilogic is trigered and writes the color to a custom property? 

0 Likes