<?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: Code to measure length and width in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13793066#M176857</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10724257"&gt;@berry.lejeune&lt;/a&gt;&amp;nbsp;I'm not sure exactly what the end result will be, but you can try this for the plates, this will give you the "geometrical dimensions of the parts in question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in iLogic you can use this code to automatically have inventor tell you the geometric extents of a part in these 3 directions, (X, Y, Z)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;1. I created a cube with 3 different dimensions in each axis (x=6", y=2", z=4")&lt;/P&gt;&lt;P&gt;2. I created 3 user-defined parameters: (Geo_Length, Geo_Height, Geo_Width)&lt;/P&gt;&lt;P&gt;3. Then I created this rule and run it&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'Dimensions&lt;/SPAN&gt;

&lt;SPAN&gt;Geo_Length&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsLength&lt;/SPAN&gt;
&lt;SPAN&gt;Geo_Width&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsWidth&lt;/SPAN&gt;
&lt;SPAN&gt;Geo_Height&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsHeight&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;4. Then check you parameters and you'll see the "extent" dimensions for the part&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2025 15:03:44 GMT</pubDate>
    <dc:creator>chris</dc:creator>
    <dc:date>2025-09-02T15:03:44Z</dc:date>
    <item>
      <title>Code to measure length and width</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13792602#M176848</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't even know if it's possible but I'll ask anyway&lt;/P&gt;&lt;P&gt;We've received a Revit model of a big building which is covered in stone plates. Now I need to get those dimensions of those plates for our manufacturer.But in stead of measuring each indivudial one, is it possible with a code to click on the surface and that it gives me the length and the width?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 10:23:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13792602#M176848</guid>
      <dc:creator>berry.lejeune</dc:creator>
      <dc:date>2025-09-02T10:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Code to measure length and width</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13793066#M176857</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10724257"&gt;@berry.lejeune&lt;/a&gt;&amp;nbsp;I'm not sure exactly what the end result will be, but you can try this for the plates, this will give you the "geometrical dimensions of the parts in question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in iLogic you can use this code to automatically have inventor tell you the geometric extents of a part in these 3 directions, (X, Y, Z)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;1. I created a cube with 3 different dimensions in each axis (x=6", y=2", z=4")&lt;/P&gt;&lt;P&gt;2. I created 3 user-defined parameters: (Geo_Length, Geo_Height, Geo_Width)&lt;/P&gt;&lt;P&gt;3. Then I created this rule and run it&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'Dimensions&lt;/SPAN&gt;

&lt;SPAN&gt;Geo_Length&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsLength&lt;/SPAN&gt;
&lt;SPAN&gt;Geo_Width&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsWidth&lt;/SPAN&gt;
&lt;SPAN&gt;Geo_Height&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsHeight&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;4. Then check you parameters and you'll see the "extent" dimensions for the part&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 15:03:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13793066#M176857</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2025-09-02T15:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Code to measure length and width</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13794020#M176882</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10724257"&gt;@berry.lejeune&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;This iLogic code works as follows: you need to run it and click on the body surface, then you get a message about the surface size. Note that the software measurement in Inventor is in centimeters, but for exported documents from Revit for some reason the measurement is in foot. So you need to adjust this in line 4 and 5 by suppressing the unnecessary piece of code.&lt;BR /&gt;You can learn more about UnitsTypeEnum at the &lt;A title="help.autodesk.com" href="https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-59997AD8-527C-4552-B90E-88D1B1F97841" target="_blank" rel="noopener"&gt;link&lt;/A&gt;.&lt;/P&gt;
&lt;LI-CODE lang="visual"&gt;Dim oInvApp As Inventor.Application = ThisApplication
Dim oCM As CommandManager = oInvApp.CommandManager
Dim oUOM As UnitsOfMeasure = oInvApp.ActiveDocument.UnitsOfMeasure
'Dim eLeng As UnitsTypeEnum = UnitsTypeEnum.kFootLengthUnits
Dim eLeng As UnitsTypeEnum = UnitsTypeEnum.kCentimeterLengthUnits

Do
	Dim oFace As Object
	oFace = oCM.Pick(SelectionFilterEnum.kPartFaceFilter, "Select Face...")
	If oFace Is Nothing Then Exit Do
	Dim oBox As Box2d = oFace.Evaluator.ParamRangeRect
	Dim oSizes(1) As Double
	oSizes(0) = Round(oUOM.ConvertUnits(oBox.MaxPoint.X - oBox.MinPoint.X,
										eLeng, oUOM.LengthUnits), 3)
	oSizes(1) = Round(oUOM.ConvertUnits(oBox.MaxPoint.Y - oBox.MinPoint.Y,
										eLeng, oUOM.LengthUnits), 3)
	MessageBox.Show("Length - " &amp;amp; Abs(oSizes.Max) &amp;amp; vbLf &amp;amp;
					"Width - " &amp;amp; Abs(oSizes.Min), "Surface size:")
	Logger.Info("Length - " &amp;amp; Abs(oSizes.Max))
	Logger.Info("Width - " &amp;amp; Abs(oSizes.Min))
Loop&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Sep 2025 06:40:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/code-to-measure-length-and-width/m-p/13794020#M176882</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2025-09-03T06:40:32Z</dc:date>
    </item>
  </channel>
</rss>

