<?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 iLogic Measure Inside Assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691028#M114560</link>
    <description>&lt;P&gt;Hi Forum!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to measure from a component occurrence inside a sub assembly to the XZ work plane on the main assembly. The component occurrence gets selected by the user and has a work surface called "Face0". My goal is to measure from "Face0" of the selected occurrence to "XZ Plane".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I've written:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsm&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&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;oAsmComp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Splice&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;
	&lt;SPAN&gt;Splice&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyLeafOccurrenceFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select a splice plate"&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Height&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
	&lt;SPAN&gt;'Height = Measure.MinimumDistance(Splice, "Face0", "", "GROUND PLANE")&lt;/SPAN&gt;
	&lt;SPAN&gt;Height&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;MinimumDistance&lt;/SPAN&gt;(&lt;SPAN&gt;Splice&lt;/SPAN&gt;, &lt;SPAN&gt;"Face0"&lt;/SPAN&gt;, &lt;SPAN&gt;oAsm&lt;/SPAN&gt;, &lt;SPAN&gt;"GROUND PLANE"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code currently gets an error not sure why. I was wondering if someone has worked on a code similar to this before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The occurrence part is inside "Assembly1" and I am running the code from "Assembly2" as shown in the snippet below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="iLogic Snip.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/807215i33328DB98CDF2314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="iLogic Snip.png" alt="iLogic Snip.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 07:01:45 GMT</pubDate>
    <dc:creator>felix.cortes5K3Y2</dc:creator>
    <dc:date>2020-08-14T07:01:45Z</dc:date>
    <item>
      <title>iLogic Measure Inside Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691028#M114560</link>
      <description>&lt;P&gt;Hi Forum!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to measure from a component occurrence inside a sub assembly to the XZ work plane on the main assembly. The component occurrence gets selected by the user and has a work surface called "Face0". My goal is to measure from "Face0" of the selected occurrence to "XZ Plane".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I've written:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsm&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&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;oAsmComp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Splice&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;
	&lt;SPAN&gt;Splice&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyLeafOccurrenceFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select a splice plate"&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Height&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
	&lt;SPAN&gt;'Height = Measure.MinimumDistance(Splice, "Face0", "", "GROUND PLANE")&lt;/SPAN&gt;
	&lt;SPAN&gt;Height&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;MinimumDistance&lt;/SPAN&gt;(&lt;SPAN&gt;Splice&lt;/SPAN&gt;, &lt;SPAN&gt;"Face0"&lt;/SPAN&gt;, &lt;SPAN&gt;oAsm&lt;/SPAN&gt;, &lt;SPAN&gt;"GROUND PLANE"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code currently gets an error not sure why. I was wondering if someone has worked on a code similar to this before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The occurrence part is inside "Assembly1" and I am running the code from "Assembly2" as shown in the snippet below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="iLogic Snip.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/807215i33328DB98CDF2314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="iLogic Snip.png" alt="iLogic Snip.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 07:01:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691028#M114560</guid>
      <dc:creator>felix.cortes5K3Y2</dc:creator>
      <dc:date>2020-08-14T07:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Measure Inside Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691079#M114563</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7060191"&gt;@felix.cortes5K3Y2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's strange, but it seems there is no way to use Measure.MinimumDistance to measure the distance between an entity in a component and an entity in the top level assembly...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then we'll have to use more advanced API functionality:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmComp&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oUM&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UnitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;UnitsOfMeasure&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyLeafOccurrenceFilter&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Select a splice plate"&lt;/SPAN&gt;)
	
	&lt;SPAN style="color: #808080;"&gt;'Create a proxy for Face0 (The face in the context of the assembly)&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFace0&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Object&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateGeometryProxy&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;GetNamedEntity&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Face0"&lt;/SPAN&gt;), &lt;SPAN style="color: #800000;"&gt;oFace0&lt;/SPAN&gt;)
	
	&lt;SPAN style="color: #808080;"&gt;'Get the XZ Plane of the assembly&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oXZplane&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;WorkPlane&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oAsmComp&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkPlanes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"XZ Plane"&lt;/SPAN&gt;)
	
	&lt;SPAN style="color: #808080;"&gt;'Measure distance&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;MeasureTools&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetMinimumDistance&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFace0&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oXZplane&lt;/SPAN&gt;)
	&lt;SPAN style="color: #808080;"&gt;'Convert distance from database units to default units of the document&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oUM&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oUM&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;LengthUnits&lt;/SPAN&gt;)
	&lt;SPAN style="color: #808080;"&gt;'Return the value in a messagebox just to control that it's right&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GetNamedEntity&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Object&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;attribMgr&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AttributeManager&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AttributeManager&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ObjectCollection&lt;/SPAN&gt;
    &lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;attribMgr&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FindObjects&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"iLogicEntityNameSet"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogicEntityName"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt;)
    
    &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Count&lt;/SPAN&gt; &amp;gt; 0 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(1))
    &lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Nothing&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Aug 2020 07:40:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691079#M114563</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-14T07:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Measure Inside Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691735#M114604</link>
      <description>&lt;P&gt;Hi Jhoel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked great! Is there any way to measure the Y distance? That's the dimension most crucial for me and I thought that the minimum distance would give me that dimension. Either way thank you for helping me out!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 14:30:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9691735#M114604</guid>
      <dc:creator>felix.cortes5K3Y2</dc:creator>
      <dc:date>2020-08-14T14:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Measure Inside Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9694522#M114643</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7060191"&gt;@felix.cortes5K3Y2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe something like this should give you the Y-value:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmComp&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oUM&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UnitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;UnitsOfMeasure&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyLeafOccurrenceFilter&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Select a splice plate"&lt;/SPAN&gt;)
	
	&lt;SPAN style="color: #808080;"&gt;'Create a proxy for Face0 (The face in the context of the assembly)&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFace0&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Object&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateGeometryProxy&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;GetNamedEntity&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Splice&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Face0"&lt;/SPAN&gt;), &lt;SPAN style="color: #800000;"&gt;oFace0&lt;/SPAN&gt;)
	
	&lt;SPAN style="color: #808080;"&gt;'Get the XZ Plane of the assembly&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oXZplane&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;WorkPlane&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oAsmComp&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkPlanes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"XZ Plane"&lt;/SPAN&gt;)
	
	&lt;SPAN style="color: #808080;"&gt;'Measure distance&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oNV&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;NameValueMap&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;MeasureTools&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetMinimumDistance&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFace0&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oXZplane&lt;/SPAN&gt;, , , &lt;SPAN style="color: #800000;"&gt;oNV&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oVector&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Vector&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oNV&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"ClosestPointOne"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;VectorTo&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oNV&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"ClosestPointTwo"&lt;/SPAN&gt;))
	&lt;SPAN style="color: #808080;"&gt;'Convert distance from database units to default units of the document&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oUM&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Abs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oVector&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Y&lt;/SPAN&gt;), &lt;SPAN style="color: #800000;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oUM&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;LengthUnits&lt;/SPAN&gt;)
	&lt;SPAN style="color: #808080;"&gt;'Return the value in a messagebox just to control that it's right&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Height&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GetNamedEntity&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Object&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;attribMgr&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AttributeManager&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AttributeManager&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ObjectCollection&lt;/SPAN&gt;
    &lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;attribMgr&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FindObjects&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"iLogicEntityNameSet"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogicEntityName"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt;)
    
    &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Count&lt;/SPAN&gt; &amp;gt; 0 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;objsFound&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(1))
    &lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Nothing&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 06:38:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/9694522#M114643</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-17T06:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Measure Inside Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/11380704#M141786</link>
      <description>&lt;P&gt;Has anyone since found a way to&lt;SPAN&gt;&amp;nbsp;use Measure.MinimumDistance to measure the distance between an entity in a component and an entity in the top level assembly?&amp;nbsp;Measure.MinimumDistance works really well for what I'm writing, since you don't need to define what type of geometry/feature you are measuring between, i.e. you just have to specify their names.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 13:26:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/11380704#M141786</guid>
      <dc:creator>Russell.BrownVEZMW</dc:creator>
      <dc:date>2022-08-25T13:26:07Z</dc:date>
    </item>
    <item>
      <title>Betreff: iLogic Measure Inside Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/12960219#M170744</link>
      <description>&lt;P&gt;Hi Russel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;maybe a trick can help you:&lt;/P&gt;&lt;P&gt;Place a dummy component (as reference part, no impact for BOM and weight, can be an empty file without geometry) at the origin to your assy and measure to this!?! Maybe not the best , but will be totally easy without that bunch of coding.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 09:54:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-measure-inside-assembly/m-p/12960219#M170744</guid>
      <dc:creator>Kay_Rethmeier</dc:creator>
      <dc:date>2024-08-15T09:54:36Z</dc:date>
    </item>
  </channel>
</rss>

