01-20-2023
10:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-20-2023
10:34 AM
The weird thing about the whitespace is that from Inventor point of view seems to be treated like an empty string except for what we see in the spreadsheet. But this is just a thing related to the setting via model state table, setting an iProperty in the active document/model state to whitespace is possible and is not equal to empty string.
- Open new part
- create a model state
- create a custom iProperty named testprop in Model State1
- activate primary model state
- edit the testprop to another value (now the column of that property is in the excel table)
- Run the following rule:
Dim propName As String = "testprop" Dim propTblHeader As String = "Custom" Dim msName As String = "Model State1" Dim propValue As String = "" Dim facDoc As Document = ThisApplication.ActiveDocument Dim msTbl As ModelStateTable = facDoc.ComponentDefinition.ModelStates.ModelStateTable Dim tblClms As ModelStateTableColumns = msTbl.TableColumns Dim thisClm As ModelStateTableColumn = tblClms.Item(propName & " [" & propTblHeader & "]") If String.IsNullOrEmpty(propValue) Then propValue = " " End If Dim thisCell As ModelStateTableCell = thisClm.Item(msName) thisCell.Value = propValue If String.IsNullOrEmpty(thisCell.Value) Then Logger.Info("Empty cell now") End If facDoc.ComponentDefinition.ModelStates.Item(msName).Activate() If String.IsNullOrEmpty(iProperties.Value("Custom", propName)) Then Logger.Info("Empty iProp too") End If