<?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: Re : Creating polyLine Arc using C# for AutoCAD 2014 in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7634267#M33011</link>
    <description>&lt;P&gt;@Anonymous&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;In view of the screenshots you send, it seems that you are ignoring some AutoCAD basics (like the _OFFSET command).&lt;/SPAN&gt;&lt;BR /&gt;In my opinion, it is not possible to pretend to customize AutoCAD with code without mastering these databases.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;You should start by learning how to use the _OFFSET command, then you can better understand how the &lt;A href="http://help.autodesk.com/view/OARX/2018/ENU/?guid=OREFNET-Autodesk_AutoCAD_DatabaseServices_Curve_GetOffsetCurves_double" target="_blank"&gt;GetOffsetCurves() method&lt;/A&gt; works (if the offset distance is positive the curve is offseted to the right, if it is negative, to the left).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Dec 2017 08:23:09 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2017-12-19T08:23:09Z</dc:date>
    <item>
      <title>Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6834947#M33000</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I am new in C# coding to drive the AutoCAD interface. Can any one help to draw a Polyline using C# Code as like attached snap for AutoCAd 2014 ??.&lt;/P&gt;&lt;P&gt;User can provide the PromptPointOptions !!!.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 07:17:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6834947#M33000</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2017-01-27T07:17:04Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6835098#M33001</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;There is a lack of information to respond to your request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What exactly are the input data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AutoCAD manages the arc polyline segments with the bulge concept.&lt;/SPAN&gt; &lt;SPAN&gt;The bulge of a segment is equal to the tangent of the quarter of the angle of the arc (IOW, the arc sagitta divided by half of the chord).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Here is an example that reproduces the behavior of the&lt;/SPAN&gt;&lt;SPAN class=""&gt; _PLINE&lt;/SPAN&gt;&lt;SPAN class=""&gt; native command by computing the bulge so that the arc is tangent to the previous segment.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        [CommandMethod("Test")]
        public void Test()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            // prompt for first point
            var options = new PromptPointOptions("\nFirst point: ");
            var result = ed.GetPoint(options);
            if (result.Status != PromptStatus.OK)
                return;
            var pt1 = result.Value;

            // prompt for second point
            options.Message = "\nSecond point: ";
            options.BasePoint = pt1;
            options.UseBasePoint = true;
            result = ed.GetPoint(options);
            if (result.Status != PromptStatus.OK)
                return;
            var pt2 = result.Value;

            // prompt for third point
            options.Message = "\nThird point: ";
            options.BasePoint = pt2;
            result = ed.GetPoint(options);
            if (result.Status != PromptStatus.OK)
                return;
            var pt3 = result.Value;

            // convert points to 2d points
            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
            var p1 = pt1.Convert2d(plane);
            var p2 = pt2.Convert2d(plane);
            var p3 = pt3.Convert2d(plane);

            // compute the bulge of the second segment
            var angle1 = p1.GetVectorTo(p2).Angle;
            var angle2 = p2.GetVectorTo(p3).Angle;
            var bulge = Math.Tan((angle2 - angle1) / 2.0);

            // add the polyline to the current space
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                var curSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                using (var pline = new Polyline())
                {
                    pline.AddVertexAt(0, p1, 0.0, 0.0, 0.0);
                    pline.AddVertexAt(1, p2, bulge, 0.0, 0.0);
                    pline.AddVertexAt(2, p3, 0.0, 0.0, 0.0);
                    pline.TransformBy(ed.CurrentUserCoordinateSystem);
                    curSpace.AppendEntity(pline);
                    tr.AddNewlyCreatedDBObject(pline, true);
                }
                tr.Commit();
            }
        }&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 08:39:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6835098#M33001</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-01-27T08:39:06Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6835362#M33002</link>
      <description>&lt;P&gt;It works, Thank you very much........, Actually, I am new in this (.net) area and trying to create AutoCAD entities through the application (.NET) for the AutoCAD interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:40:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6835362#M33002</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2017-01-27T11:40:55Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6839726#M33003</link>
      <description>&lt;P&gt;Can you give more help Please, to create PolyLine from First point to Second point with fixed length (Current LTSCALE). Actually, After getting the first point the Polyline Automatically drawn a polyline as per current LTSCALE value (Current LTSCALE = Auto drawn polyline) followed the second point angle now the Arc will be drawn after getting the second vertex..&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 09:46:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6839726#M33003</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2017-01-30T09:46:22Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6839804#M33004</link>
      <description>&lt;P&gt;Sorry, I cannot understand what you want to do.&lt;/P&gt;
&lt;P&gt;Could you provide a clearer explaination, maybe with some picture, and try to think at all necessary inputs to create the polyline (a length from a point is not enough to define another point).&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 10:30:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6839804#M33004</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-01-30T10:30:14Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6839849#M33005</link>
      <description>&lt;P&gt;Here Providing a Snap...Please, Help&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 10:57:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6839849#M33005</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2017-01-30T10:57:47Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6840024#M33006</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just replace:&lt;/P&gt;
&lt;PRE&gt;var pt2 = result.Value;&lt;/PRE&gt;
&lt;P&gt;with:&lt;/P&gt;
&lt;PRE&gt;var pt2 = pt1 + pt1.GetVectorTo(result.Value).GetNormal() * db.Ltscale;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 12:38:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6840024#M33006</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-01-30T12:38:06Z</dc:date>
    </item>
    <item>
      <title>Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6840101#M33007</link>
      <description>&lt;P&gt;You can also prompt the user for the first segment angle instead of a second point and compute the second point according to the angle and the LTSCALE value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        [CommandMethod("Test")]
        public void Test()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            // prompt for first point
            var options = new PromptPointOptions("\nSpecify the first point: ");
            var result = ed.GetPoint(options);
            if (result.Status != PromptStatus.OK)
                return;
            var pt1 = result.Value;

            // prompt for the first segment angle
            var angleOptions = new PromptAngleOptions("\nSpecify the first segment angle: ");
            angleOptions.BasePoint = pt1;
            angleOptions.UseBasePoint = true;
            var angleResult = ed.GetAngle(angleOptions);
            if (angleResult.Status != PromptStatus.OK)
                return;&lt;BR /&gt;&lt;BR /&gt;            // compute the second point
            var pt2 = new Point3d(
                pt1.X + Math.Cos(angleResult.Value) * db.Ltscale, 
                pt1.Y + Math.Sin(angleResult.Value) * db.Ltscale, 
                pt1.Z);

            // prompt for third point
            options.Message = "\nSpecify the arc end point: ";
            options.BasePoint = pt2;
            options.UseBasePoint = true;
            result = ed.GetPoint(options);
            if (result.Status != PromptStatus.OK)
                return;
            var pt3 = result.Value;

            // convert points to 2d points
            var plane = new Plane();
            var p1 = pt1.Convert2d(plane);
            var p2 = pt2.Convert2d(plane);
            var p3 = pt3.Convert2d(plane);

            // compute the bulge of the second segment
            var angle1 = p1.GetVectorTo(p2).Angle;
            var angle2 = p2.GetVectorTo(p3).Angle;
            var bulge = Math.Tan((angle2 - angle1) / 2.0);

            // add the polyline to the current space
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                var curSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                using (var pline = new Polyline())
                {
                    pline.AddVertexAt(0, p1, 0.0, 0.0, 0.0);
                    pline.AddVertexAt(1, p2, bulge, 0.0, 0.0);
                    pline.AddVertexAt(2, p3, 0.0, 0.0, 0.0);
                    pline.TransformBy(ed.CurrentUserCoordinateSystem);
                    curSpace.AppendEntity(pline);
                    tr.AddNewlyCreatedDBObject(pline, true);
                }
                tr.Commit();
            }
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 13:16:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/6840101#M33007</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-01-30T13:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7631379#M33008</link>
      <description>&lt;P&gt;Hi Gilles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have an option in autocad, when we drawing Polyline with ARc option. Here is my need is to draw multiline with arc option, when user given command to draw a acr in a multiline.&lt;/P&gt;&lt;P&gt;Screen shots provided below. Request you to Please provide the code to accomplish the requirement.&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="Draw multiline with Arc Options.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/440254i148175052DB8FC40/image-size/large?v=v2&amp;amp;px=999" role="button" title="Draw multiline with Arc Options.PNG" alt="Draw multiline with Arc Options.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note :&amp;nbsp; I want to built it in Autocad 2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex Andrews.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 09:35:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7631379#M33008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-18T09:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7631878#M33009</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The multiline command does not have any Arc option because mulitiline entities cannot contain arcs (only straight segments).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may use polylines with arcs and offset them.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 12:33:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7631878#M33009</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-12-18T12:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7634041#M33010</link>
      <description>&lt;P&gt;Hi Gilles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me to draw polyline with Arc options in AutoCAD using C#.net. And the same Polyline with the combination of Arc to placed with some Offset distance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Screen shot which I shown 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="Capture.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/440714i47C74D4B7B92F795/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 06:12:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7634041#M33010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-19T06:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7634267#M33011</link>
      <description>&lt;P&gt;@Anonymous&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;In view of the screenshots you send, it seems that you are ignoring some AutoCAD basics (like the _OFFSET command).&lt;/SPAN&gt;&lt;BR /&gt;In my opinion, it is not possible to pretend to customize AutoCAD with code without mastering these databases.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;You should start by learning how to use the _OFFSET command, then you can better understand how the &lt;A href="http://help.autodesk.com/view/OARX/2018/ENU/?guid=OREFNET-Autodesk_AutoCAD_DatabaseServices_Curve_GetOffsetCurves_double" target="_blank"&gt;GetOffsetCurves() method&lt;/A&gt; works (if the offset distance is positive the curve is offseted to the right, if it is negative, to the left).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 08:23:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7634267#M33011</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-12-19T08:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Creating polyLine Arc using C# for AutoCAD 2014</title>
      <link>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7635889#M33012</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Hi Gilles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me to draw polyline with Arc options in AutoCAD using C#.net. And the same Polyline with the combination of Arc to placed with some Offset distance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Screen shot which I shown below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Your screen shot does not show two polylines that are offsets of each other. Try the OFFSET command one one of them and see if you get anything like the other.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you want help, you need to start out by attempting to solve the problem yourself, and then posting the resulting code. You seem to be just asking others here to write code for you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 17:32:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/creating-polyline-arc-using-c-for-autocad-2014/m-p/7635889#M33012</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-12-19T17:32:31Z</dc:date>
    </item>
  </channel>
</rss>

