Hi varindersra,
You can find an example at this link:
http://inventortrenches.blogspot.com/2012/05/ilogic-rule-to-change-units-of-measure.html
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi,
Thanks for the reply. I tried the code in assembly environment but it gives me an "Unspecified Error". I am using the following code please correct. And also could you provide me the code (UnitsType Enumerators) for "ft" units.
DimopenDocAsDocument
openDoc=ThisDoc.Document
openDoc.unitsofmeasure.LengthUnits=oUOM_1
IfTest1="1"Then
oUOM_1=11269
ElseIfTest1="2"Then
oUOM_1=11272
EndIf
Please correct
Regard!
Varinder
Please use the iLogic rule to change the unit with the steps below -
1. Create one unitless user parameter named "Test1"=1
2. Please copy and paste the code lines below in iLogic rule
Dim openDoc As Document
openDoc=ThisDoc.Document
If Test1=1 Then
oUOM_1=11269 'Millimeter Length
ElseIf Test1=2 Then
oUOM_1=11272 'inch length
ElseIf Test1=3 Then
oUOM_1=11273 'foot length
End If
openDoc.unitsofmeasure.LengthUnits=oUOM_1
3. When the change value of Test1, the unit in document will be changed.
For the other unit, please refer the attached spreadsheet.
Can't find what you're looking for? Ask the community or share your knowledge.