You can find an example at this link:
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
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.
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
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
3. When the change value of Test1, the unit in document will be changed.
For the other unit, please refer the attached spreadsheet.