Change Appearance across Model States
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have been trying to get a surface appearance to change across model states. The most success I have had, if I can call it that, is to access the "Model State Table" (Accessible by Right-Clicking on the Model States File in the System Tree, and then selecting "Edit Via Spreadsheet". )
Then within the iLogic Script accessing the data entry using the below.
Within the Model State Table, a Column with the Title "Appearance<style></style>" must be created and then the code below can loop through the parameters (columns) and find the column number and then change the appearance to whatever you want, in my case "FLATEX_358".
oOcc = Component.InventorComponent("LG_Expanded_Mesh:1") 'Specify the Part Model_State_Part = oOcc.ActiveModelState 'Select the Model State oMSFactory = oOcc.Definition.FactoryDocument oMSFactory.ComponentDefinition.ModelStates.Item(Model_State_Part).Activate() 'Activate the Model State
'Loop through the columns in the Model State Spreadsheet For i = 1 To oMSFactory.ComponentDefinition.ModelStates.ModelStateTable.TableColumns.Count If oMSFactory.ComponentDefinition.ModelStates.ModelStateTable.TableColumns.Item(i).Heading = "Appearance" Then Appearance_Column = i Exit For End If Next i
'Write the string of the surface appearance you would like oMSFactory.ComponentDefinition.ModelStates.ModelStateTable.TableColumns.Item(Appearance_Column).Item(Model_State_Part).Value = "FLATEX_358"
The problem I have with the above method is that it is not stable. The appreance only changes when the model state of higher up assemblies or the parts are changed multiple times and then at some point it does what I would like it to do. I am basically trying to change the appearance from a pattern to transparent when I change the model state.
If anybody has any further input or ideas as to how to get the appearance to change accross model states, please let me know. I have also noted that you can change material across model state but not appearance so I suspect that this may be addressed soon.
Regards