Message 1 of 11
How to run iLogic rules from assembly with Model States in parts ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have an iLogic rule in an ipt file, which works fine from the ipt. But, if I insert this ipt in an iam, then Run all rules from the assembly, it no longer works if the ipt contains Model States.
How can I fix this ?
Dim oMyParameters As UserParameters
Dim oParameter As UserParameter
oDoc = ThisDoc.FactoryDocument
oParameters = oDoc.ComponentDefinition.Parameters
oMyParameters = oParameters.UserParameters
'Delete parameter MyParam if it exist
Try
oMyParameters("MyParam").Delete
Catch
End Try
'Create parameter MyParam
MsgBox("Create MyParam")
oParameter = oMyParameters.AddByExpression("MyParam", "10", kDefaultDisplayLengthUnits)
'Format MyParam
oParameters("MyParam").ExposedAsProperty = True
With oParameters("MyParam").CustomPropertyFormat
.ShowLeadingZeros = True
.ShowTrailingZeros = False
.ShowUnitsString = True
.Units = "m"
.Precision = Inventor.CustomPropertyPrecisionEnum.kThreeDecimalPlacesPrecision
End With
'Affect MyParam (formatted) to custom property MyProperty, then delete it
MsgBox("Affect MyParam to MyProperty")
iProperties.Value("Custom", "MyProperty") = iProperties.Value("Custom", "MyParam")
MsgBox("Delete MyParam")
oMyParameters("MyParam").delete
Alain