iLogic code to find the appearance of the first feature

iLogic code to find the appearance of the first feature

dsl145
Advocate Advocate
590 Views
2 Replies
Message 1 of 3

iLogic code to find the appearance of the first feature

dsl145
Advocate
Advocate

So I tend to model where I have the material for say a plate of steel be given the appearance of 'polished steel' and then I make the features in the model be a paint colour (eg. smooth - white). The reason for this is so that when I move the parts into a weldment and do a machining operation, the material that is machined away is left nice and shiny (so that it looks machined).

 

What I need is a piece of iLogic code that will detect what the appearance/part color is of the first features so that I can run a background code which ties in the client's specific color code and paint spec when a part is 'painted' using my method.

 

How do I generically detect what the appearance/part color of the first feature is?

0 Likes
Accepted solutions (1)
591 Views
2 Replies
Replies (2)
Message 2 of 3

clutsa
Collaborator
Collaborator
Accepted solution
Dim doc = ThisDoc.Document
Dim compDef = doc.componentDefinition
Dim Feat1 = compDef.Features.Item(1)
Dim partColor = Feature.Color(Feat1.Name)
MessageBox.Show("partColor = " & partColor, "Title")

Does this work for you?

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

Message 3 of 3

dsl145
Advocate
Advocate

Works like butter!!! Awesome Smiley Very Happy

0 Likes