Assigned Names for faces Change Color using Ilogic or API

Assigned Names for faces Change Color using Ilogic or API

Andrew_Burnett
Enthusiast Enthusiast
1,305 Views
2 Replies
Message 1 of 3

Assigned Names for faces Change Color using Ilogic or API

Andrew_Burnett
Enthusiast
Enthusiast

I am looking for a way that probably doesn't exist.  I want to change the color of a face in a part file using the assigned name for the face.  Is there any code that will allow you to do this?

 

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

MjDeck
Autodesk
Autodesk
Accepted solution

You can do this with the NamedEntities iLogic API. Here's a sample (which requires that a few appearance assets already exist in the part).

Dim partDoc As PartDocument = ThisDoc.Document
Dim namedEntities = iLogicVb.Automation.GetNamedEntities(partDoc)
Dim face0 As Face = namedEntities.FindEntity("Face0")
face0.Appearance = partDoc.AppearanceAssets(2)

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 3 of 3

Andrew_Burnett
Enthusiast
Enthusiast

Thank you for the quick response.  It worked great.

 

0 Likes