<?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: Creating linear diameter dimension using API in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238671#M333604</link>
    <description>&lt;P&gt;Hello, here is an example for how to create a diameter via API, hope it helps a little bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;----------------------&lt;/P&gt;
&lt;P&gt;Sub AddDiaDim()&lt;BR /&gt; Dim oPart As PartDocument&lt;BR /&gt; Set oPart = ThisApplication.Documents.Add(kPartDocumentObject)&lt;BR /&gt; &lt;BR /&gt; Dim oCompDef As PartComponentDefinition&lt;BR /&gt; Set oCompDef = oPart.ComponentDefinition&lt;BR /&gt; &lt;BR /&gt; Dim oPlnSk As PlanarSketch&lt;BR /&gt; Set oPlnSk = oCompDef.Sketches.Add(oCompDef.WorkPlanes("XY Plane"))&lt;BR /&gt; &lt;BR /&gt; Dim oTG As TransientGeometry&lt;BR /&gt; Set oTG = ThisApplication.TransientGeometry&lt;BR /&gt; &lt;BR /&gt; Dim oSkArc As SketchArc&lt;BR /&gt; Set oSkArc = oPlnSk.SketchArcs.AddByCenterStartEndPoint(oTG.CreatePoint2d(0, 0), oTG.CreatePoint2d(2, 4), oTG.CreatePoint2d(4, 4))&lt;BR /&gt; &lt;BR /&gt; Dim oDiaDim As DiameterDimConstraint&lt;BR /&gt; Set oDiaDim = oPlnSk.DimensionConstraints.AddDiameter(oSkArc, oTG.CreatePoint2d(0, 0))&lt;BR /&gt; &lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;---------------------------&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2016 07:26:25 GMT</pubDate>
    <dc:creator>Xun.Zhang</dc:creator>
    <dc:date>2016-03-29T07:26:25Z</dc:date>
    <item>
      <title>Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238619#M333603</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two sketch lines and its start point and end point and I need to add linear diameter dimension using API on those lines.&lt;/P&gt;&lt;P&gt;How do I create linear diameter dimension using API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prarthana&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 06:30:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238619#M333603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-29T06:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238671#M333604</link>
      <description>&lt;P&gt;Hello, here is an example for how to create a diameter via API, hope it helps a little bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;----------------------&lt;/P&gt;
&lt;P&gt;Sub AddDiaDim()&lt;BR /&gt; Dim oPart As PartDocument&lt;BR /&gt; Set oPart = ThisApplication.Documents.Add(kPartDocumentObject)&lt;BR /&gt; &lt;BR /&gt; Dim oCompDef As PartComponentDefinition&lt;BR /&gt; Set oCompDef = oPart.ComponentDefinition&lt;BR /&gt; &lt;BR /&gt; Dim oPlnSk As PlanarSketch&lt;BR /&gt; Set oPlnSk = oCompDef.Sketches.Add(oCompDef.WorkPlanes("XY Plane"))&lt;BR /&gt; &lt;BR /&gt; Dim oTG As TransientGeometry&lt;BR /&gt; Set oTG = ThisApplication.TransientGeometry&lt;BR /&gt; &lt;BR /&gt; Dim oSkArc As SketchArc&lt;BR /&gt; Set oSkArc = oPlnSk.SketchArcs.AddByCenterStartEndPoint(oTG.CreatePoint2d(0, 0), oTG.CreatePoint2d(2, 4), oTG.CreatePoint2d(4, 4))&lt;BR /&gt; &lt;BR /&gt; Dim oDiaDim As DiameterDimConstraint&lt;BR /&gt; Set oDiaDim = oPlnSk.DimensionConstraints.AddDiameter(oSkArc, oTG.CreatePoint2d(0, 0))&lt;BR /&gt; &lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;---------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 07:26:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238671#M333604</guid>
      <dc:creator>Xun.Zhang</dc:creator>
      <dc:date>2016-03-29T07:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238708#M333605</link>
      <description>Thank you very much.&lt;BR /&gt;I will try this code and will let you know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prarthana</description>
      <pubDate>Tue, 29 Mar 2016 07:55:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238708#M333605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-29T07:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238736#M333606</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to explain my problem in detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have selected these two lines from the code, Line 1 and Line 2 &amp;nbsp;(marked in red).&lt;/P&gt;&lt;P&gt;And I have the Line1 start point and end point as (0, 3.5) and (3, 3.5)&lt;/P&gt;&lt;P&gt;and Line 2 which is a construction geometry line as (0,0) and (31, 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, what I need to do is to add the linear diameter dimension (ᴓ7) (marked in yellow color) using API&amp;nbsp;of these two lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I am able to explain my problem.Please help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prarthana&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/227740i9DEA72E1BFF373D0/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="キャプチャ.PNG" title="キャプチャ.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 08:30:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6238736#M333606</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-29T08:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6239258#M333607</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am a bit confused, do you want to add a linear diameter dimension between those two lines? is it correct? so which point is the start point and which one is the end? suppose start point should from one of line, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you help give me more details on the expectation result with a snapshot or sketch to show how the dimension lies finnally.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 13:16:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6239258#M333607</guid>
      <dc:creator>Xun.Zhang</dc:creator>
      <dc:date>2016-03-29T13:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240656#M333608</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am sorry for the confusion.&lt;/P&gt;&lt;P&gt;If I am not wrong, in order to create the linear diameter dimension we need to select the lines or with the points, right?&lt;/P&gt;&lt;P&gt;So for that, I select the two lines Line1 and Line2. The Line1&amp;nbsp; has its start point and end point and so with the Line2.&lt;/P&gt;&lt;P&gt;I do have the information of both the lines but what I need is to get the distance between these two lines (linear diameter) using API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the previous image, I created distance (marked in yellow)from the Inventor, but I need to create that dimension using API.&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/228022i9094405A50A71512/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="キャプチャ1.PNG" title="キャプチャ1.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 00:46:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240656#M333608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-30T00:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240698#M333609</link>
      <description>&lt;P&gt;Hi, Clear enough now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try below transcription.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;----------------------------&lt;/P&gt;
&lt;P&gt;Public Sub OffsetDimConstraint()&lt;BR /&gt; ' Set a reference to the active sketch.&lt;BR /&gt; Dim oSketch As PlanarSketch&lt;BR /&gt; Set oSketch = ThisApplication.ActiveEditObject&lt;BR /&gt; &lt;BR /&gt; ' Set a reference to the transient geometry collection.&lt;BR /&gt; Dim oTransGeom As TransientGeometry&lt;BR /&gt; Set oTransGeom = ThisApplication.TransientGeometry&lt;BR /&gt; &lt;BR /&gt; Dim oSketchLine As SketchLine&lt;BR /&gt; Set oSketchLine = oSketch.SketchLines.Item(1)&lt;BR /&gt; &lt;BR /&gt; Dim oSketchEntity As SketchEntity&lt;BR /&gt; Set oSketchEntity = oSketch.SketchEntities.Item(6)&lt;/P&gt;
&lt;P&gt;Dim oOffsetDimConstraint As OffsetDimConstraint&lt;BR /&gt; Set oOffsetDimConstraint = oSketch.DimensionConstraints.AddOffset(oSketchLine, oSketchEntity, oTransGeom.CreatePoint2d(0, 0), &lt;FONT color="#008000"&gt;&lt;STRONG&gt;True&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/228029i44E8B0D5DA78DDBC/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="0003.png" title="0003.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 02:12:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240698#M333609</guid>
      <dc:creator>Xun.Zhang</dc:creator>
      <dc:date>2016-03-30T02:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240771#M333610</link>
      <description>Thank you very much.&lt;BR /&gt;It solved my problem . &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Can I ask one more question?&lt;BR /&gt;Can we record the macro in Inventor like in Solidworks?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prarthana</description>
      <pubDate>Wed, 30 Mar 2016 04:11:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240771#M333610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-30T04:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240785#M333611</link>
      <description>Hi, Please copy all code in notepad and save as *.bas with type "all file", Open VBA Environment and File-&amp;gt;import, then a new module is added.</description>
      <pubDate>Wed, 30 Mar 2016 04:42:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240785#M333611</guid>
      <dc:creator>Xun.Zhang</dc:creator>
      <dc:date>2016-03-30T04:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating linear diameter dimension using API</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240797#M333612</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;With Regards,&lt;BR /&gt;Prarthana</description>
      <pubDate>Wed, 30 Mar 2016 04:58:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/m-p/6240797#M333612</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-30T04:58:16Z</dc:date>
    </item>
  </channel>
</rss>

