<?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: How to interpret length values in inches, not centimeters? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928698#M152011</link>
    <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was kind of hoping that wasn't the case (the 'database' units and all) but it is easy enough to get around. I just wanted to make sure there wasn't a more 'official' method before I just convert all user input myself.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 15:12:35 GMT</pubDate>
    <dc:creator>amillsLD4X8</dc:creator>
    <dc:date>2023-04-28T15:12:35Z</dc:date>
    <item>
      <title>How to interpret length values in inches, not centimeters?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928581#M152007</link>
      <description>&lt;P&gt;Why does Inventor interpret my dimension values in units of "cm" and not "in"?&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I'm trying to do in the code below is draw a circle with a diameter of 120 in. But it creates a circle with diameter of 47.244 in. It looks like Inventor is taking my 120 in "cm" and then&amp;nbsp;by dividing by 2.54 to converting to "cm". Is there away to tell Inventor that the 120 is already in inches?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought line 17 would tell the document to interpret length values in "in", but it doesn't look like that is happening.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub BuildPart()

'Get value from user input
Dim circleRadius As Double
circleID = 120

'Define Inventor Document
Dim app As Application
Set app = Inventor.ThisApplication
Dim partDoc As Document

Set partDoc = app.Documents.Add(kPartDocumentObject, ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject))
Set compDef = partDoc.ComponentDefinition
Set tG = app.TransientGeometry

'Change units of document
partDoc.UnitsOfMeasure.LengthUnits = UnitsTypeEnum.kInchLengthUnits

'Create sketch
Dim baseSketch As PlanarSketch
Set baseSketch = compDef.Sketches.Add(compDef.WorkPlanes.Item(2))

'Create circle in sketch
Dim tankID As SketchCircle
Set tankID = baseSketch.SketchCircles.AddByCenterRadius(tG.CreatePoint2d(0, 0), circleID / 2)

End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="amillsLD4X8_0-1682691655965.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1208006iAAA8553A56F4B097/image-size/medium?v=v2&amp;amp;px=400" role="button" title="amillsLD4X8_0-1682691655965.png" alt="amillsLD4X8_0-1682691655965.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 14:28:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928581#M152007</guid>
      <dc:creator>amillsLD4X8</dc:creator>
      <dc:date>2023-04-28T14:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to interpret length values in inches, not centimeters?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928665#M152009</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13579796"&gt;@amillsLD4X8&lt;/a&gt;.&amp;nbsp; Centimeters are Inventor's default length units (database units) used for everything behind the scenes in all their code.&amp;nbsp; Any raw numbers in your code that are supposed to represent length measurements that have units, will be automatically interpreted as representing centimeters.&amp;nbsp; It has always been this way, and will likely never change.&amp;nbsp; You can just expect this behavior and use simple math to convert, or you can use the built-in units converter function (Document.UnitsOfMeasure.ConvertUnits).&amp;nbsp; Most of the values you get back from stuff in Inventor are also in 'database units', there are different default units for different types of measurements (angle, mass, time, etc).&amp;nbsp; There are a few situations where you will get 'document' units, but it would be difficult to list them all here.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 15:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928665#M152009</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-04-28T15:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to interpret length values in inches, not centimeters?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928675#M152010</link>
      <description>&lt;P&gt;Adding a plug (link) to my related idea on the Inventor Ideas forum, just for the exposure.&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@1E018E9C237C1988568EE667885B902C/emoticons/1f601.png" alt=":beaming_face_with_smiling_eyes:" title=":beaming_face_with_smiling_eyes:" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/add-property-method-to-api-for-parameter-type-objects-get-set/idc-p/10957489" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-ideas/add-property-method-to-api-for-parameter-type-objects-get-set/idc-p/10957489&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 15:06:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928675#M152010</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-04-28T15:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to interpret length values in inches, not centimeters?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928698#M152011</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was kind of hoping that wasn't the case (the 'database' units and all) but it is easy enough to get around. I just wanted to make sure there wasn't a more 'official' method before I just convert all user input myself.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 15:12:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928698#M152011</guid>
      <dc:creator>amillsLD4X8</dc:creator>
      <dc:date>2023-04-28T15:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to interpret length values in inches, not centimeters?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928744#M152014</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13579796"&gt;@amillsLD4X8&lt;/a&gt;.&amp;nbsp; One good thing to keep in mind that may make things a bit easier is to look for anything that has a Property named 'Expression', besides having a Property named 'Value'.&amp;nbsp; The value of the 'Expression' property is always a String (text), instead of numerical or other Type.&amp;nbsp; And anything you provide as the value of that Expression will be understood/used literally.&amp;nbsp; So, you could say Object.Expression = "6.25 in" and it will be understood as 6 inches, without the units being converted.&amp;nbsp; Think of it like typing something into the Equation column of a parameter, in the parameters dialog box.&amp;nbsp; You can also put a quoted equation as the value of the Expression property in some situations (like a parameter).&amp;nbsp; And there are some places in code where it is asking for a "Variant" or "Object" as the value of something, where you would expect to supply a numerical value.&amp;nbsp; That often means that it will accept a String, as well as a Double (or other numerical data type), and you can use that the same way (supply a quoted value, with units specified).&amp;nbsp; Just some more tips to keep in mind.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 15:35:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928744#M152014</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-04-28T15:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to interpret length values in inches, not centimeters?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928961#M152019</link>
      <description>&lt;P&gt;Awesome, thank you for the tip.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 16:58:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-interpret-length-values-in-inches-not-centimeters/m-p/11928961#M152019</guid>
      <dc:creator>amillsLD4X8</dc:creator>
      <dc:date>2023-04-28T16:58:21Z</dc:date>
    </item>
  </channel>
</rss>

