03-16-2023
02:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-16-2023
02:07 PM
Hello,
I'm retrieving a parameter value using "userparams("S1GW").Value". This method automatically converts my inch value to cm. How do I retrieve my original inch value without the conversion to cm?
Dim userparams As UserParameters = oADef.Parameters.UserParameters For Each Param In userparams Dim oTotalDict As New Dictionary(Of String, String) oTotalDict.Add(userparams("S1GW").Name, userparams("S1GW").Value)
Solved! Go to Solution.
03-16-2023
02:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-16-2023
02:21 PM
The most simple example looks like this:
Dim doc As PartDocument = ThisDoc.Document
Dim param As [Parameter] = doc.ComponentDefinition.Parameters.Item("TestParameter")
Dim uom = doc.UnitsOfMeasure
uom.ConvertUnits(param.Value, UnitsTypeEnum.kDatabaseLengthUnits, UnitsTypeEnum.kInchLengthUnits)
But you can find more information about converting units here:
http://www.hjalte.nl/46-parameter-document-database-units
There you will also find a method to convert to fractional strings .
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com