11-22-2023
10:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-22-2023
10:25 AM
I may have cobbled together a working solution heavily inspired by ("stealing from") this post.
This is what I did:
- I toggled to factory scope, and added a true/false parameter called "PAINT" (I'm not sure if I needed to change the factory scope or not--- I'm still new to how model states behave with adding/removing parameters).
- I went to one member and changed the value to "false", so it would appear in the Excel table.
- I set the remainder of the true/false values for every model state.
- I added entity names to the surfaces, like "TOP_FACE", "OUTSIDE_DIAMETER"
- I added an iLogic rule (based on the above linked post)
'set this rule to watch this parameter oTrigger = PAINT Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oEntities As Object oEntities = iLogicVb.Automation.GetNamedEntities(oDoc) 'get the named face Dim oFace1 As Face Dim oFace2 As Face oFace1 = oEntities.FindEntity("TOP_FACE") oFace2 = oEntities.FindEntity("OUTSIDE_DIAMETER") 'set the color if paramter is true If Parameter("PAINT") = True Then oFace1.Appearance = oDoc.Assets.Item("*Blue") oFace2.Appearance = oDoc.Assets.Item("*Blue") Else oFace1.Appearance = oDoc.ActiveAppearance oFace2.Appearance = oDoc.ActiveAppearance End If
- I set that rule to the event trigger for any model state change.
It appears to work. Some model states turn blue, and others don't.