Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
CattabianiI
in reply to: WCrihfield

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.

  1. Open new part
  2. create a model state
  3. create a custom iProperty named testprop in Model State1
  4. activate primary model state
  5. edit the testprop to another value (now the column of that property is in the excel table)
  6. 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