- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi ,
I managed to design a windows form to make some changes to a model, but i have a problem when the user inserts a numeric value in a text box. for example when the user inserts a value of 1970 i get in inventor parameters 1970.00000000 mm. I've tried many times to adjust the Part Precision but it's not helping. Part lin dim Precision is set by default to 3 .
Here is also part of the code that i wrote, hope you could help me to set that parameter to default and to get a result of 1970.00 mm
'Declare the Application object()
Dim oApplication As Inventor.Application
' Obtain the Inventor Application object.
' This assumes Inventor is already running.
oApplication = GetObject(, "Inventor.Application")
' Set a reference to the active document.
' This assumes a document is open.
Dim oCurrentDocument As PartDocument
oCurrentDocument = oApplication.ActiveDocument
' Get the custom property set.
Dim CustomPropSet As PropertySet
CustomPropSet = oCurrentDocument.PropertySets.Item("Inventor User Defined Properties")
Dim userParams As UserParameters
userParams = oCurrentDocument.ComponentDefinition.Parameters.UserParameters
Dim oUOM As UnitsOfMeasure
oUOM = oCurrentDocument.UnitsOfMeasure
' Get the enum value that defines the current default length units.
Dim eLengthUnit As UnitsTypeEnum
eLengthUnit = oUOM.LengthUnits
PanelHeight = txtPanelHeight.Text
Dim oparamh2 As Inventor.Parameter
oparamh2 = userParams.Item("h2") 'h2 is the panel height
oparamh2.Value = oUOM.GetValueFromExpression(PanelHeight, eLengthUnit)
Many Thanks
Ashraf
Solved! Go to Solution.