<?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: changing model units API in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-model-units-api/m-p/5659227#M56279</link>
    <description>&lt;P&gt;I have a code which allows the change from mm to inches which could be adapted to suit your needs.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'get input from user&lt;BR /&gt;oUnit = InputRadioBox("Select a units of measure type", "millimeter", "inch", True, "ilogic")&lt;BR /&gt;If oUnit = True Then&lt;BR /&gt;'set to millimeter&lt;BR /&gt;oUOM_1 = UnitsTypeEnum.kMillimeterLengthUnits&lt;BR /&gt;Else&lt;BR /&gt;'set to inch&lt;BR /&gt;oUOM_1 = UnitsTypeEnum.kInchLengthUnits&lt;BR /&gt;End If&lt;BR /&gt;'Define the open document&lt;BR /&gt;Dim openDoc As Document&lt;BR /&gt;openDoc = ThisDoc.Document&lt;BR /&gt;'Look at all of the files referenced in the open document&lt;BR /&gt;Dim docFile As Document&lt;BR /&gt;For Each docFile In openDoc.AllReferencedDocuments&lt;BR /&gt;'look at only part files&lt;BR /&gt;If docFile.DocumentType = kPartDocumentObject Then&lt;BR /&gt;'format file name&lt;BR /&gt;Dim FNamePos As Long&lt;BR /&gt;FNamePos = InStrRev(docFile.FullFileName, "\", -1)&lt;BR /&gt;Dim docFName As String&lt;BR /&gt;docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)&lt;BR /&gt;'set length units&lt;BR /&gt;docFile.unitsofmeasure.LengthUnits = oUOM_1&lt;BR /&gt;'rebuild to update the display&lt;BR /&gt;docFile.Rebuild&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;iLogicVb.UpdateWhenDone = True&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2015 10:47:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-01T10:47:11Z</dc:date>
    <item>
      <title>changing model units API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-model-units-api/m-p/5659213#M56278</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can get the current units of the model (lets say its mm), but I wanna change the units to meter and save the file.&lt;/P&gt;
&lt;P&gt;I could not find any API to perform this task. Though I know the document settings UI in Inventor but I need API to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in Advance,&lt;/P&gt;
&lt;P&gt;Tikeshwar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 10:34:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-model-units-api/m-p/5659213#M56278</guid>
      <dc:creator>NemKumar</dc:creator>
      <dc:date>2015-06-01T10:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: changing model units API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-model-units-api/m-p/5659227#M56279</link>
      <description>&lt;P&gt;I have a code which allows the change from mm to inches which could be adapted to suit your needs.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'get input from user&lt;BR /&gt;oUnit = InputRadioBox("Select a units of measure type", "millimeter", "inch", True, "ilogic")&lt;BR /&gt;If oUnit = True Then&lt;BR /&gt;'set to millimeter&lt;BR /&gt;oUOM_1 = UnitsTypeEnum.kMillimeterLengthUnits&lt;BR /&gt;Else&lt;BR /&gt;'set to inch&lt;BR /&gt;oUOM_1 = UnitsTypeEnum.kInchLengthUnits&lt;BR /&gt;End If&lt;BR /&gt;'Define the open document&lt;BR /&gt;Dim openDoc As Document&lt;BR /&gt;openDoc = ThisDoc.Document&lt;BR /&gt;'Look at all of the files referenced in the open document&lt;BR /&gt;Dim docFile As Document&lt;BR /&gt;For Each docFile In openDoc.AllReferencedDocuments&lt;BR /&gt;'look at only part files&lt;BR /&gt;If docFile.DocumentType = kPartDocumentObject Then&lt;BR /&gt;'format file name&lt;BR /&gt;Dim FNamePos As Long&lt;BR /&gt;FNamePos = InStrRev(docFile.FullFileName, "\", -1)&lt;BR /&gt;Dim docFName As String&lt;BR /&gt;docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)&lt;BR /&gt;'set length units&lt;BR /&gt;docFile.unitsofmeasure.LengthUnits = oUOM_1&lt;BR /&gt;'rebuild to update the display&lt;BR /&gt;docFile.Rebuild&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;iLogicVb.UpdateWhenDone = True&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 10:47:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-model-units-api/m-p/5659227#M56279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-01T10:47:11Z</dc:date>
    </item>
  </channel>
</rss>

