I am trying to have iLogic change the custom property format for my user parameters. I am able to work with linear measurements, but I would like to also work with angular measurements. I want my angular units to be "Degrees" the format to be "Deg-Min-Sec" and the precision to be DD MM.
Below is my code to change the units to deg, but I can't change the format or precision:
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oParameter As Parameter
Dim oFormat As CustomPropertyFormat
For Each oParameter In oPartDoc.ComponentDefinition.Parameters.UserParameters
oFormat = oParameter.CustomPropertyFormat 'set the parameter as a custom property
oParameter.ExposedAsProperty = True 'export the parameter as an iProperty
oFormat.PropertyType = Inventor.CustomPropertyTypeEnum.kTextPropertyType 'set the custom iProperty as a text type
oFormat.Units = "deg" 'sets the unit type.
Next oParameter
It's in the .Precision setting:
kDegreesAnglePrecision
kMinutesAnglePrecision
kSecondsAnglePrecision
Will set format to Deg-Min-Sec
Dim oPartDoc As PartDocument = ThisDoc.Document Dim oParameter As Parameter For Each oParameter In oPartDoc.ComponentDefinition.Parameters.UserParameters Dim oFormat As CustomPropertyFormat = oParameter.CustomPropertyFormat oParameter.ExposedAsProperty = True 'export the parameter as an iProperty oFormat.PropertyType = Inventor.CustomPropertyTypeEnum.kTextPropertyType oFormat.Units = "deg" ' When you set the precision it will change to Deg-Min-Sec oFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kDegreesAnglePrecision oFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kMinutesAnglePrecision oFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kSecondsAnglePrecision Next oParameter
For the Degree and minutes I only see one option from the API, but seconds has:
kSecondsOneDecimalPlaceAnglePrecision
kSecondsTwoDecimalPlaceAnglePrecision
kSecondsThreeDecimalPlaceAnglePrecision
kSecondsFourDecimalPlaceAnglePrecision