<?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: Drawing : automated diameter dimensions in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9779108#M116533</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the solution this works as I need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have just a question about the position of the dimension. You use vector, but it's the first time I see that.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oPoint As Point2d = oIntent.PointOnSheet.Copy
Dim oVector As Vector2d = aoDrawCurves3.CenterPoint.VectorTo(oPoint)
oVector.ScaleBy(.3)
oVector.AddVector(ThisApplication.TransientGeometry.CreateVector2d(oVector.X, Abs(oVector.X)))
oPoint.TranslateBy(oVector)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to choose the position so, could you explain me how vectors work ? and how can I use it to choose the position ?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2020 15:23:55 GMT</pubDate>
    <dc:creator>patrice.vallet</dc:creator>
    <dc:date>2020-10-01T15:23:55Z</dc:date>
    <item>
      <title>Drawing : automated diameter dimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9778934#M116528</link>
      <description>&lt;P&gt;I'm working to automate a drawing.&lt;/P&gt;&lt;P&gt;I have found on the forum how to add dimension between 2 workpoints and 2 face and I have automated some of my dimension using attribute on face and workpoint of my model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'm struggling to add a dimension diameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add this kind of dimension by ilogic but I didn't find something.&lt;/P&gt;&lt;P&gt;Is it possible ? If yes how can I do that ? If not, are there an other way to indicate the diameter ?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/826054i112BADD4F0D5FBD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:15:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9778934#M116528</guid>
      <dc:creator>patrice.vallet</dc:creator>
      <dc:date>2020-10-01T14:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing : automated diameter dimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9778989#M116529</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8675539"&gt;@patrice.vallet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this &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;
&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Sheet&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oView&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DrawingViews&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCurve&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingCurve&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oView&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DrawingCurves&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCurve&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CurveType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;CurveTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kCircleCurve&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oIntent&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GeometryIntent&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateGeometryIntent&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oCurve&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;PointIntentEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kCircularLeftPointIntent&lt;/SPAN&gt;)
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Point2d&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oIntent&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PointOnSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Copy&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;Vector2d&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oCurve&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CenterPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;VectorTo&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPoint&lt;/SPAN&gt;)
		&lt;SPAN style="color: #800000;"&gt;oVector&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScaleBy&lt;/SPAN&gt;(.3)
		&lt;SPAN style="color: #800000;"&gt;oVector&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddVector&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateVector2d&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oVector&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;X&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;X&lt;/SPAN&gt;)))
		&lt;SPAN style="color: #800000;"&gt;oPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TranslateBy&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oVector&lt;/SPAN&gt;)
	&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DrawingDimensions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GeneralDimensions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddDiameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPoint&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oIntent&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&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;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;It'll add diameter dimension to ALL circles on the sheet. But you can modify it to only add the dimensions to the circles you want, now that you have the example code &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>Thu, 01 Oct 2020 14:44:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9778989#M116529</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-10-01T14:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing : automated diameter dimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9779108#M116533</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the solution this works as I need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have just a question about the position of the dimension. You use vector, but it's the first time I see that.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oPoint As Point2d = oIntent.PointOnSheet.Copy
Dim oVector As Vector2d = aoDrawCurves3.CenterPoint.VectorTo(oPoint)
oVector.ScaleBy(.3)
oVector.AddVector(ThisApplication.TransientGeometry.CreateVector2d(oVector.X, Abs(oVector.X)))
oPoint.TranslateBy(oVector)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to choose the position so, could you explain me how vectors work ? and how can I use it to choose the position ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 15:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9779108#M116533</guid>
      <dc:creator>patrice.vallet</dc:creator>
      <dc:date>2020-10-01T15:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing : automated diameter dimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9780300#M116556</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8675539"&gt;@patrice.vallet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm glad that it worked as expected. I just used a vector to translate a point in this case. The function to place the diameter dimension still takes a point as an argument.&lt;/P&gt;
&lt;P&gt;A vector has a magnitude (length) and a direction. What the code does is that it first gets the vector representing the relative difference in position between the point of our geometry intent (the point that our arrow for the dimension will attach to) and the centerpoint of the circle. this gives us a direction straight to the left in this case and a magnitude being the radius of the circle. I then scale the vector by a factor of 0.3 , dubble the length in X direction and add the previous x-value of the direction to the y value of the vector. It's all just operations to get the point to where I think it wood look good. Then I take a copy of our intent point and translates it by this vector, giving me a point at a good relative position to the intent point in my opinion. That is the point I then use as position for the dimension text.&lt;/P&gt;
&lt;P&gt;I hope this made some sense to you &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@F982DDE76110C67DBDB6AF220B48480A/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 05:57:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9780300#M116556</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-10-02T05:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing : automated diameter dimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9780539#M116561</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the explanation. I have to try by myself to change value to understand perfectly the vector.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the moment I have used the following code to place my dimension (something I am used with)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oPt1 As Point2d
oPt1 = oTG.CreatePoint2d(oView.Left +oView.Width- 1,oView.Top+1)

Dim oID As GeneralDimension
oID = oGeneralDims.AddDiameter(oPt1, oIntent, False)&lt;/LI-CODE&gt;&lt;P&gt;So I have this result :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 200px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/826442i2D8203D1135881FB/image-size/small?v=v2&amp;amp;px=200" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And what I want :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 192px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/826443iB865F774517AF72D/image-size/small?v=v2&amp;amp;px=200" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;As you can see the code pick the bottom left point.&lt;/P&gt;&lt;P&gt;Do you know how can I position the picking point ?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 08:49:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9780539#M116561</guid>
      <dc:creator>patrice.vallet</dc:creator>
      <dc:date>2020-10-02T08:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing : automated diameter dimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9780616#M116562</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8675539"&gt;@patrice.vallet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This has to do with the LeaderFromCenter-property in GeneralDimensions.AddDiameter.&lt;/P&gt;
&lt;P&gt;Try your last line like this &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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;oID&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oGeneralDims&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddDiameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPt1&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oIntent&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 10:11:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-automated-diameter-dimensions/m-p/9780616#M116562</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-10-02T10:11:06Z</dc:date>
    </item>
  </channel>
</rss>

