Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Expert,
I can not compare part number of a part and the name of a parameter. Please help me to fix this problem.
Here is my code. Thank you.
SyntaxEditor Code Snippet
Imports Inventor.CustomPropertyPrecisionEnum Imports Inventor.CustomPropertyTypeEnum Dim oPart As PartDocument oPart = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition oCompDef = oPart.ComponentDefinition oFeatures = oCompDef.Features Dim oParameter As Parameter oModelParams = oCompDef.Parameters i = 1 For Each oParameter In oModelParams Dim oPartNum as String = iProperties.Value("Project", "Part Number") & ":" & If (i < 10, "0" + CStr(i), CStr(i)) & ":Height" If oParameter.Name = oPartNum Then Select Case sName Case oPartNum oModelParams.Item(i).ExposedAsProperty = True oModelParams.Item(i).CustomPropertyFormat.PropertyType = kTextPropertyType oModelParams.Item(i).CustomPropertyFormat.Precision = kThreeDecimalPlacesPrecision oModelParams.Item(i).CustomPropertyFormat.ShowLeadingZeros = False oModelParams.Item(i).CustomPropertyFormat.ShowTrailingZeros = False oModelParams.Item(i).CustomPropertyFormat.ShowUnitsString = True oModelParams.Item(i).CustomPropertyFormat.Units = "mm" End Select End If i = i + 1 Next
Ngoc Son
Autodesk User
Autodesk User
Solved! Go to Solution.