Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor 2013 iLogic unit change

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
varindersra
2059 Views, 3 Replies

Inventor 2013 iLogic unit change

Hi,

 

How do I chnage the document units using iLogic rules.

 

Regards!

varinder

3 REPLIES 3
Message 2 of 4

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

Message 3 of 4

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

Message 4 of 4
Yijiang.Cai
in reply to: varindersra

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.

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report