Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
varindersra
Posts: 252
Registered: ‎09-28-2009
Message 1 of 4 (882 Views)
Accepted Solution

Inventor 2013 iLogic unit change

882 Views, 3 Replies
08-23-2012 11:26 AM

Hi,

 

How do I chnage the document units using iLogic rules.

 

Regards!

varinder

*Expert Elite*
Curtis_Waguespack
Posts: 2,878
Registered: ‎03-08-2006
Message 2 of 4 (880 Views)

Re: Inventor 2013 iLogic unit change

08-23-2012 11:31 AM in reply to: varindersra

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



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Distinguished Contributor
varindersra
Posts: 252
Registered: ‎09-28-2009
Message 3 of 4 (867 Views)

Re: Inventor 2013 iLogic unit change

08-23-2012 02:43 PM in reply to: Curtis_Waguespack

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

Employee
Yijiang.Cai
Posts: 358
Registered: ‎05-20-2008
Message 4 of 4 (859 Views)

Re: Inventor 2013 iLogic unit change

08-23-2012 08:16 PM 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.
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.