<?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: Convert segment of polyline into arc in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909594#M3223</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can check if a polyline segment is an arc using the &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Polyline_GetSegmentType_int" target="_blank" rel="noopener"&gt;Polyline.GetSegmentType method&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If the result is &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_SegmentType" target="_blank" rel="noopener"&gt;SegmentType&lt;/A&gt;.Arc, you can get the corresponding CircularArc3d using the &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Polyline_GetArcSegmentAt_int" target="_blank" rel="noopener"&gt;Polyline.GetArcSegmentAt method&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If needed, you can convert the returned CircularArc3d into an Arc entity with the &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Curve_CreateFromGeCurve_Curve3d" target="_blank" rel="noopener"&gt;Curve.CreateFromGeCurve mehod&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jul 2024 16:08:57 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2024-07-20T16:08:57Z</dc:date>
    <item>
      <title>Convert segment of polyline into arc</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909554#M3222</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How can I convert a segment of a polyline (where bulge ≠ 0) into an arc?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 15:19:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909554#M3222</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2024-07-20T15:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert segment of polyline into arc</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909594#M3223</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can check if a polyline segment is an arc using the &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Polyline_GetSegmentType_int" target="_blank" rel="noopener"&gt;Polyline.GetSegmentType method&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If the result is &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_SegmentType" target="_blank" rel="noopener"&gt;SegmentType&lt;/A&gt;.Arc, you can get the corresponding CircularArc3d using the &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Polyline_GetArcSegmentAt_int" target="_blank" rel="noopener"&gt;Polyline.GetArcSegmentAt method&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If needed, you can convert the returned CircularArc3d into an Arc entity with the &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Curve_CreateFromGeCurve_Curve3d" target="_blank" rel="noopener"&gt;Curve.CreateFromGeCurve mehod&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 16:08:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909594#M3223</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-07-20T16:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert segment of polyline into arc</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909959#M3224</link>
      <description>&lt;P&gt;Thank you. indeed, I tried to implement this code based on your method, and it works well for me.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("ConvertToArc")]
        static public void runConversion()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            int indexOfArc = 0;
            PromptEntityResult acSSPrompt = ed.GetEntity("Select the polyline target");

            if (acSSPrompt.Status != PromptStatus.OK)
                return;

            using (Transaction Tx = db.TransactionManager.StartTransaction())
            {
                var btr = (BlockTableRecord)Tx.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                Polyline pl = Tx.GetObject(acSSPrompt.ObjectId, OpenMode.ForRead) as Polyline;

                if (pl!=null &amp;amp;&amp;amp; pl.GetSegmentType(indexOfArc) == SegmentType.Arc)
                {
                    CircularArc3d clrArc = pl.GetArcSegmentAt(indexOfArc);
                    //Arc newArc = new Arc(clrArc.Center, clrArc.Radius, clrArc.StartAngle, clrArc.EndAngle);
                    Arc newArc = Curve.CreateFromGeCurve(clrArc as Curve3d) as Arc;

                    newArc.ColorIndex = 1;
                    btr.AppendEntity(newArc);
                    Tx.AddNewlyCreatedDBObject(newArc, true);
                }
                Tx.Commit();
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 23:18:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-segment-of-polyline-into-arc/m-p/12909959#M3224</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2024-07-20T23:18:42Z</dc:date>
    </item>
  </channel>
</rss>

