Message 1 of 2
Exposed property not working @ creating user parameters using Try .. Catch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am back using Inventor after a spell of two years.
I was dong easily with creating all my needs. But, today, I find that I can't get around creating the user parameters.
oPara.ExposedAsProperty = True
The exposed property not doing well.
I wasted so many hours without success. Please help Thanks.
Dim oPartDoc As PartDocument
'oPartDoc = ThisDoc.Document
oPartDoc = ThisApplication.ActiveDocument
' Get the UserParameters collection
Dim userParams As UserParameters
userParams = oPartDoc.ComponentDefinition.Parameters.UserParameters
Try
oTest = Parameter("B_L2")
Catch
param = userParams.AddByExpression("B_L2", 0, UnitsTypeEnum.kFootLengthUnits)
oParam = oPartDoc.ComponentDefinition.Parameters.Item("B_L2")
oParam.Units = "ft"
oParam.Precision = Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
End Try
iLogicVb.UpdateWhenDone = True
For Each oPara In oPartDoc.ComponentDefinition.Parameters
oPara.ExposedAsProperty = True
oPara.ShowUnitsString = True
oPara.ShowLeadingZeros = False
Next oPara