<?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: ACCESSING Dimension Intersection with VBA in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9909827#M118678</link>
    <description>&lt;P&gt;Hey, thank you for explaining it to me. I was struggling to get it to work the way I needed to prior. I have used it a few times now. I noticed that sometimes the dimension is thrown all the way to the other side of the part when I do an intersection on the left side of the part view. Why does it do that. See image below.&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="inulobo_0-1606920930957.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/851124i9C34CD5A575C6CED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inulobo_0-1606920930957.png" alt="inulobo_0-1606920930957.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 14:55:38 GMT</pubDate>
    <dc:creator>inulobo</dc:creator>
    <dc:date>2020-12-02T14:55:38Z</dc:date>
    <item>
      <title>ACCESSING Dimension Intersection with VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9908491#M118649</link>
      <description>&lt;P&gt;When I need to do an intersection dimension I usually click dimension then select the first line, right-click and select intersection, select the second line, then select the third line to dimension off of. How do I automate this. I have found similar ideas but they are a little more complex than what I wanted to do. See the image below for what I mean by the intersection option. Also trying to do this specifically with a macro and not an ilogic rule.&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="inulobo_0-1606878241649.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/850853iDE0F664B3980F17D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inulobo_0-1606878241649.png" alt="inulobo_0-1606878241649.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 03:10:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9908491#M118649</guid>
      <dc:creator>inulobo</dc:creator>
      <dc:date>2020-12-02T03:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: ACCESSING Dimension Intersection with VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9908724#M118650</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9850757"&gt;@inulobo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you need to do is to create a geometry intent for the intersection point between the two drawing curves.&lt;/P&gt;
&lt;P&gt;Here's an example:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub IntersectionDimExample()

'Get the active sheet
Dim oSheet As Sheet
Set oSheet = ThisApplication.ActiveDocument.ActiveSheet

'Get the curves for intersection point
Dim oCurve1 As DrawingCurve
Set oCurve1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick first intersection curve").Parent
Dim oCurve2 As DrawingCurve
Set oCurve2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick second intersection curve").Parent

'Create GeometryIntent for intersection
Dim oIntersectionIntent As GeometryIntent
Set oIntersectionIntent = oSheet.CreateGeometryIntent(oCurve1, oCurve2)

'Get curve to set dimension to
Dim oCurve3 As DrawingCurve
Set oCurve3 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick curve to dimension to").Parent

'Create Geometry intent for that curve
Dim oCurveIntent As GeometryIntent
Set oCurveIntent = oSheet.CreateGeometryIntent(oCurve3)

'Create a text origin point for dimension
Dim oPt As Point2d
Set oPt = oIntersectionIntent.PointOnSheet
Dim oVector As Vector2d
Set oVector = oPt.VectorTo(oCurve3.MidPoint)
Call oVector.ScaleBy(1 / 2)
Call oPt.TranslateBy(oVector)

'Create the dimension
Dim oDim As LinearGeneralDimension
Set oDim = oSheet.DrawingDimensions.GeneralDimensions.AddLinear(oPt, oIntersectionIntent, oCurveIntent)

'Arrange the dimension
Dim oCol As ObjectCollection
Set oCol = ThisApplication.TransientObjects.CreateObjectCollection
Call oCol.Add(oDim)
Call oSheet.DrawingDimensions.Arrange(oCol)

End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;The macro will ask you to first pick the two curves that you want to get the intersection point of. Then pick a third curve that you want to create the dimension from the intersection point to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice how I create the intersectionpoint geometry intent by calling CreateGeometryIntent using the two curves as arguments &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 07:18:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9908724#M118650</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-12-02T07:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: ACCESSING Dimension Intersection with VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9909827#M118678</link>
      <description>&lt;P&gt;Hey, thank you for explaining it to me. I was struggling to get it to work the way I needed to prior. I have used it a few times now. I noticed that sometimes the dimension is thrown all the way to the other side of the part when I do an intersection on the left side of the part view. Why does it do that. See image below.&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="inulobo_0-1606920930957.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/851124i9C34CD5A575C6CED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inulobo_0-1606920930957.png" alt="inulobo_0-1606920930957.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 14:55:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9909827#M118678</guid>
      <dc:creator>inulobo</dc:creator>
      <dc:date>2020-12-02T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: ACCESSING Dimension Intersection with VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9910509#M118691</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9850757"&gt;@inulobo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yeah, I just wrote you an example to get the intersection point. This code places the dimension text exactly between the intersectionpoint and the midpoint of the curve we set the dimension to. Then it calls the ordinate method which will just move the dimension text somewhere outside of the view at an appropriate distance...&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 19:02:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-dimension-intersection-with-vba/m-p/9910509#M118691</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-12-02T19:02:50Z</dc:date>
    </item>
  </channel>
</rss>

