<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ILogic rule to change all units in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12845658#M133461</link>
    <description>&lt;P&gt;Hello worked on it and found the answer to your query,works smoothly and solves your problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;unitsOfMeasure&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;
&lt;SPAN&gt;unitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;lengthUnits&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;

&lt;SPAN&gt;lengthUnits&lt;/SPAN&gt; = &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;kMillimeterLengthUnits&lt;/SPAN&gt;
&lt;/FONT&gt;
&lt;SPAN&gt;unitsOfMeasure&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt;=&lt;SPAN&gt;lengthUnits&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can change the highlighted unit as per your requirement.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2024 03:10:52 GMT</pubDate>
    <dc:creator>aniketpunwatkar</dc:creator>
    <dc:date>2024-06-18T03:10:52Z</dc:date>
    <item>
      <title>ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3710860#M133448</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am after a rule to change the unit type of all .ipts from cm to mm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has to go down to all levels in hierarchy &amp;nbsp;but only change .ipt files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any code would be appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dave&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/43390i863245C3FD420C1D/image-size/original?v=mpbl-1&amp;amp;px=-1" title="Convert to mm.JPG" alt="Convert to mm.JPG" align="center" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 05:07:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3710860#M133448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-26T05:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3711628#M133449</link>
      <description>&lt;P&gt;Hi dclunie,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this will work for you (if you modify it a bit):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'get input from user
oUnit = InputRadioBox("Select a units of measure type", "Metric", "Imperial", False, "ilogic")

If oUnit = True then 
'set to millimeter
oUOM_1 = UnitsTypeEnum.kMillimeterLengthUnits 
'set to kilogram
oUOM_2 = UnitsTypeEnum.kKilogramMassUnits
Else 
'set to inch
oUOM_1 = UnitsTypeEnum.kInchLengthUnits 
'set to pounds mass
oUOM_2 = UnitsTypeEnum.kLbMassMassUnits 		
End if

'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document

'Look at all of the files referenced in the open document
Dim docFile As Document 
For Each docFile In openDoc.AllReferencedDocuments	
	'look at only part files
	 If docFile.DocumentType = kPartDocumentObject Then	
	'format  file name		
	Dim FNamePos As Long
	FNamePos = InStrRev(docFile.FullFileName, "\", -1)		         
	Dim docFName As String	
	docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)       
	'set length units 
	docFile.unitsofmeasure.LengthUnits = oUOM_1 
	'set mass units 
	docFile.unitsofmeasure.MassUnits = oUOM_2 
	'rebuild to update the display
	docFile.Rebuild
	End If
Next	
iLogicVb.UpdateWhenDone = True&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a variation of this rule:&lt;/P&gt;&lt;P&gt;&lt;A href="http://inventortrenches.blogspot.com/2012/05/ilogic-rule-to-change-units-of-measure.html" target="_blank"&gt;http://inventortrenches.blogspot.com/2012/05/ilogic-rule-to-change-units-of-measure.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 18:15:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3711628#M133449</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-11-26T18:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3711640#M133450</link>
      <description>&lt;P&gt;Here's a version specifically, directed toward changing from mm to cm:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'get input from user
oUnit = InputRadioBox("Select a units of measure type", "millimeter", "centimeter", True, "ilogic")

If oUnit = True then 
'set to millimeter
oUOM_1 = UnitsTypeEnum.kMillimeterLengthUnits 
Else 
'set to centimeter
oUOM_1 = UnitsTypeEnum.kCentimeterLengthUnits 
	
End if

'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document

'Look at all of the files referenced in the open document
Dim docFile As Document 
For Each docFile In openDoc.AllReferencedDocuments	
	'look at only part files
	 If docFile.DocumentType = kPartDocumentObject Then	
	'format  file name		
	Dim FNamePos As Long
	FNamePos = InStrRev(docFile.FullFileName, "\", -1)		         
	Dim docFName As String	
	docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)       
	'set length units 
	docFile.unitsofmeasure.LengthUnits = oUOM_1 
	'rebuild to update the display
	docFile.Rebuild
	End If
Next	
iLogicVb.UpdateWhenDone = True&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 18:22:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3711640#M133450</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-11-26T18:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3808298#M133451</link>
      <description>&lt;P&gt;Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the OP didn't say thank you I will. This just saved one of my staff a tonne of time. Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Scott.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 19:48:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/3808298#M133451</guid>
      <dc:creator>scottmoyse</dc:creator>
      <dc:date>2013-03-18T19:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/8460460#M133452</link>
      <description>&lt;P&gt;thank you for your post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I managed to change globally the lbpounds of the parts to kg. The bom was also updated positively.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I need to add a rule in order this change is permanent. (I use the parts in other projects).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the rule (under) : it works only once. When I reopen the assembly with all the parts, the unit is again lb pounds.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specific question. I need to have the kg unit for each part. Permanently stored in the properties of the individual part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;get input from user&lt;/SPAN&gt;
&lt;SPAN&gt;oUnit&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;InputRadioBox&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Select a unit of measure type&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Metric&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Imperial&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;ilogic&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oUnit&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; 
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;set to millimeter&lt;/SPAN&gt;
&lt;SPAN&gt;oUOM_1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;kMillimeterLengthUnits&lt;/SPAN&gt; 
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;set to kilogram&lt;/SPAN&gt;
&lt;SPAN&gt;oUOM_2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;kKilogramMassUnits&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;/SPAN&gt; 
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;set to inch&lt;/SPAN&gt;
&lt;SPAN&gt;oUOM_1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;kInchLengthUnits&lt;/SPAN&gt; 
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;set to pounds mass&lt;/SPAN&gt;
&lt;SPAN&gt;oUOM_2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;kLbMassMassUnits&lt;/SPAN&gt;         
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Define the open document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;openDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;openDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Look at all of the files referenced in the open document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;docFile&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; 
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;docFile&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;openDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;    
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;look at only part files&lt;/SPAN&gt;
     &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;docFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;    
     
     &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;set mass units &lt;/SPAN&gt;
    &lt;SPAN&gt;docFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;unitsofmeasure&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;MassUnits&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oUOM_2&lt;/SPAN&gt; 
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;rebuild to update the display&lt;/SPAN&gt;
    &lt;SPAN&gt;docFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Rebuild&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
    
&lt;SPAN&gt;Next&lt;/SPAN&gt;    
&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;True&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you for helping me. &lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Dec 2018 16:36:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/8460460#M133452</guid>
      <dc:creator>toon.gielen</dc:creator>
      <dc:date>2018-12-11T16:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/11661990#M133453</link>
      <description>&lt;P&gt;&lt;SPAN&gt;if you want to permanently stored in the properties of the individual part. add this line under the line&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;docFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Rebuild&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;docFile.save&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 17:08:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/11661990#M133453</guid>
      <dc:creator>yan.wangBKEWN</dc:creator>
      <dc:date>2023-01-06T17:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/11943487#M133454</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_W&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code was just what I was looking for. But can this also be done for an individual file? I used the code on an assembly and there it changes all the parts to mm. But I actually need it for an individual part.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 08:28:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/11943487#M133454</guid>
      <dc:creator>berry.lejeune</dc:creator>
      <dc:date>2023-05-05T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/11943503#M133455</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_W&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figured it out already. It was just one line what I needed&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt; = &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kMillimeterLengthUnits&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 08:42:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/11943503#M133455</guid>
      <dc:creator>berry.lejeune</dc:creator>
      <dc:date>2023-05-05T08:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12053033#M133456</link>
      <description>&lt;P&gt;Thank you for all your contributions.&lt;/P&gt;&lt;P&gt;This rule that you shared is very close to what I am looking for.&lt;/P&gt;&lt;P&gt;I need to change units to inch but without user input. I have an excising rule that takes an iAssembly one member at a time, shrinkwraps,save as ipt save as stp save as dwg but somehow Inventor is changing the units from inch to cm when saving as ipt and that ipt being saved as dwg causes the scale to be at 2.54, meaning that if a length is 48 in in the iAssembly the dwg ends up being 48*2.54. So I thought maybe I can insert change units after it saves as ipt and them stp dwg&lt;/P&gt;&lt;P&gt;Our IT man that wrote all those rules for me retired last month &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 13:20:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12053033#M133456</guid>
      <dc:creator>Jolanta_Voigt</dc:creator>
      <dc:date>2023-06-22T13:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12053155#M133457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14062764"&gt;@Jolanta_Voigt&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This example will change all of the documents in an assembly to inches.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;docFile&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN&gt;docFile&lt;/SPAN&gt;.&lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt; = &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kInchLengthUnits&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 14:04:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12053155#M133457</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2023-06-22T14:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12053226#M133458</link>
      <description>&lt;P&gt;First and foremost I always appreciate your help.&lt;/P&gt;&lt;P&gt;I read more about this on your blog, now I understand better what is happening after reading the section about the internal Inventor units being in cm, that explains my issue why the dwg is scaled to 2.54.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 14:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12053226#M133458</guid>
      <dc:creator>Jolanta_Voigt</dc:creator>
      <dc:date>2023-06-22T14:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12548437#M133459</link>
      <description>&lt;P&gt;For some reason, it doesn't work for me. i want to change all the parameters that i created in mm to cm. did i misunderstand something ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 12:52:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12548437#M133459</guid>
      <dc:creator>Alexrose1942</dc:creator>
      <dc:date>2024-02-08T12:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12548481#M133460</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3315348"&gt;@Alexrose1942&lt;/a&gt;.&amp;nbsp; You are talking about changing the units of parameter objects.&amp;nbsp; This forum thread is talking about changing the 'default' document level units.&amp;nbsp; The default document level units are set manually within the Document Settings.&amp;nbsp; The document settings button is located on the Tools tab, Options panel.&amp;nbsp; Within that dialog, on the Units tab is where these settings are found manually.&amp;nbsp; That is what they are doing here in this discussion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want a code solution for changing the units of parameters, then it may be better to start a different forum topic for that.&amp;nbsp; Also, you would need to specify all the details of the task, because code needs to be extremely specific.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What document type would be active when the code starts (part, assembly, drawing)?&lt;/LI&gt;
&lt;LI&gt;Do you want the code to target only the active document, only target the active document's immediately referenced documents, only target all levels of referenced documents, or the active document and referenced documents?&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;If effecting referenced documents, then what document types do you want it to effect (parts, assemblies, drawings)?&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Which parameter types should it target (only UserParameters, or ModelParameters and/or other types too)?&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;And any other useful details that we may need to know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Edit:&amp;nbsp; Attached is a text file containing the code for an example iLogic rule you can play around with.&amp;nbsp; It can be ran on any document type.&amp;nbsp; It will 'process' that active document, and it will 'process' all levels of that document's referenced documents, without filtering out any specific document type.&amp;nbsp; The code is modular (multiple routines), with one custom Function routine just for retrieving the Parameters collection from a supplied Document (because it is done differently for models and drawings), and a custom Sub routine just for the primary parameter unit replacement task, designed to process an entire Parameters collection at a time.&amp;nbsp; That second routine could easily be converted to process a single parameter at a time, instead of an entire collection though.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 13:58:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12548481#M133460</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-02-08T13:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic rule to change all units</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12845658#M133461</link>
      <description>&lt;P&gt;Hello worked on it and found the answer to your query,works smoothly and solves your problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;unitsOfMeasure&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;
&lt;SPAN&gt;unitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;lengthUnits&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;

&lt;SPAN&gt;lengthUnits&lt;/SPAN&gt; = &lt;SPAN&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;kMillimeterLengthUnits&lt;/SPAN&gt;
&lt;/FONT&gt;
&lt;SPAN&gt;unitsOfMeasure&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt;=&lt;SPAN&gt;lengthUnits&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can change the highlighted unit as per your requirement.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 03:10:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-rule-to-change-all-units/m-p/12845658#M133461</guid>
      <dc:creator>aniketpunwatkar</dc:creator>
      <dc:date>2024-06-18T03:10:52Z</dc:date>
    </item>
  </channel>
</rss>

