<?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 Polyline Circle made of many short line segments to normal Circle. in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9790310#M94222</link>
    <description>&lt;P&gt;Thank You Good Sir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You helped me save time from individually redrawing a lot of circles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway I can repay you ?&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 00:20:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-08T00:20:36Z</dc:date>
    <item>
      <title>Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9786276#M94211</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have drawings with many circular polylines that I transfer to ProNest 8 and then feed it to a machine to cut holes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is there are too many nodes on the polylines that Pronest 8 cant compute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried searching the forums myself and tried the LISP that are given but none of them work. Is there any better way to solve this problem rather than redrawing the drawing I have ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyhelp would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 10:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9786276#M94211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-06T10:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9786299#M94212</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;FONT color="#999999"&gt;&lt;EM&gt;Convert Polyline Circle made of many short line segments to normal Circle.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I'm afraid that it's NOT applicable .&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 10:13:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9786299#M94212</guid>
      <dc:creator>imadHabash</dc:creator>
      <dc:date>2020-10-06T10:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9786662#M94213</link>
      <description>&lt;P&gt;I tried applying PolygonToCircle.lsp with its Pg2C command, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/circle-to-polyline-circular-polyline-to-circle/m-p/3363929/highlight/true#M302780" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;, but it didn't work.&amp;nbsp; I found that your polygon has &lt;EM&gt;coincident vertices&lt;/EM&gt;, with a zero-length segment at the end, which would make most such routines fail.&amp;nbsp; I fixed that, but Pg2C still didn't work.&amp;nbsp; I tried loosening up its test on how precisely regular the polygon is, but it still didn't.&amp;nbsp; So there must be something just far-enough off from regular about that polygon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I made a modification of the code &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/circle-to-polyline-circular-polyline-to-circle/m-p/3365139/highlight/true#M302796" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;, to draw a &lt;EM&gt;&lt;STRONG&gt;3Point Circle&lt;/STRONG&gt;&lt;/EM&gt;, using the start vertex, one about 1/3 of the way around, and one about 2/3 of the way around:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:Pg2C ; = PolyGon-[to]-Circle conversion
  (/ pl verts)
  (setq pl (car (entsel "\nSelect at-least-3-sided Polyline to convert to Circle: ")))
  (if (&amp;gt; (setq verts (cdr (assoc 90 (entget pl)))) 2)
    (progn
      (command "_.circle" "_3P"
        "_none" (vlax-curve-getPointAtParam pl 0)
        "_none" (vlax-curve-getPointAtParam pl (/ verts 3))
        "_none" (vlax-curve-getPointAtParam pl (* (/ verts 3) 2))
      )
      (entdel pl)
    )
  )
)

(prompt "\nType Pg2C to convert PolyGon(s) to Circle(s).")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could use all the usual enhancements, but it worked on the one in your sample drawing, even &lt;EM&gt;without&lt;/EM&gt;&amp;nbsp; fixing the coincident vertices problem.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:22:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9786662#M94213</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-10-06T13:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787034#M94214</link>
      <description>&lt;P&gt;Another approach&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(DEFUN c:test (/ es pt ext dia)
  (SETQ es (ENTSEL))			;Select the polyline
  (SETQ pt (OSNAP (CADR es) "GCE"))	;assume the center should be at the geometric center
  (SETQ ext (ACET-ENT-GEOMEXTENTS (CAR es))) ;find the extents)
  (SETQ
    dia	(APPLY 'MIN
	       (CDR (REVERSE (APPLY 'MAPCAR (CONS '- (REVERSE ext)))))
	)
  )					;return the minimum of the width or height
  (COMMAND "_.circle" pt "dia" dia)	;draw the circle.
  (COMMAND "_.erase" es "")		;delete the polyline (optional
					; other enhancements: copy properties of polyline to circle.
  (PRINC)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787034#M94214</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2020-10-06T15:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787287#M94215</link>
      <description>&lt;P&gt;As if you need another approach, here's one that finds the bounding box, and draws a Circle centered in it, with the radius calculated from its diagonal in a way that suits this kind of polygon.&amp;nbsp; It can be used on any kind of object.&amp;nbsp; For anything with equal extents in the X and Y directions, the Circle is inscribed in the bounding box.&amp;nbsp; For things of different proportions, it will be larger than the bounding box in one direction and smaller in the other.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:O2C-BB ; = Object {to} Circle based on Bounding Box
  (/ ent LL UR)
  (setq ent (car (entsel "\nSelect object to convert to Circle: ")))
  (vla-getboundingbox (vlax-ename-&amp;gt;vla-object ent) 'minpt 'maxpt)
  (setq
    LL (vlax-safearray-&amp;gt;list minpt)
    UR (vlax-safearray-&amp;gt;list maxpt)
  )
  (command "_.circle"
    "_none" (mapcar '/ (mapcar '+ LL UR) '(2 2 2)); center
    (/ (distance LL UR) (sqrt 2) 2); radius
  )
  (entdel ent)
  (princ)
)

(prompt "\nType O2C-BB to convert an object to a Circle based on its Bounding Box.")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:58:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787287#M94215</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-10-06T17:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787416#M94216</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI - I just tested this (the PG2C routine) with an equilateral triangle (2d polyline created with POLYGON) and it does nothing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: PG2C&lt;/P&gt;&lt;P&gt;Select at-least-3-sided Polyline to convert to Circle: nil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:56:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787416#M94216</guid>
      <dc:creator>dmfrazier</dc:creator>
      <dc:date>2020-10-06T18:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787425#M94217</link>
      <description>&lt;P&gt;This one (O2C-BB) worked on the equilateral triangle.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:59:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787425#M94217</guid>
      <dc:creator>dmfrazier</dc:creator>
      <dc:date>2020-10-06T18:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787459#M94218</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13156"&gt;@dmfrazier&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;... I just tested this (the PG2C routine) with an equilateral triangle (2d polyline created with POLYGON) and it does nothing:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It works for me.&amp;nbsp; Do you have PLINETYPE set to 0, so it makes "heavy" Polylines instead of "lightweight" ones?&amp;nbsp; The (assoc 90) entry in entity data for the number of vertices will be there only for LWPolylines, not "heavy" ones.&amp;nbsp; The LW ones will be called "Polyline" in the top of the Properties palette, compared to "2D Polyline" for "heavy" ones.&lt;/P&gt;
&lt;P&gt;[&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;EDIT:&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; For any who would need to do this with "heavy" Polyline polygons, it could be adjusted to look at the end VLA Parameter value, rather than the number of vertices, because a "heavy" Polyline will have that, whereas it doesn't have the (assoc 90) entry for the number of vertices that a "lightweight" one has.]&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 19:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787459#M94218</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-10-06T19:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787476#M94219</link>
      <description>&lt;P&gt;&lt;EM&gt;"Do you have PLINETYPE set to make "heavy" Polylines instead of "lightweight" ones?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yup (PLINETYPE = 0):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(-1 . &amp;lt;Entity name: 218b5126160&amp;gt;)&lt;BR /&gt;(0 . "POLYLINE")&lt;BR /&gt;(330 . &amp;lt;Entity name: 218c73a79f0&amp;gt;)&lt;BR /&gt;(5 . "246")&lt;BR /&gt;(100 . "AcDbEntity")&lt;BR /&gt;(67 . 0)&lt;BR /&gt;(410 . "Model")&lt;BR /&gt;(8 . "0")&lt;BR /&gt;(100 . "AcDb2dPolyline")&lt;BR /&gt;(66 . 1)&lt;BR /&gt;(10 0.0 0.0 0.0)&lt;BR /&gt;(70 . 1)&lt;BR /&gt;(40 . 0.0)&lt;BR /&gt;(41 . 0.0)&lt;BR /&gt;(210 0.0 0.0 1.0)&lt;BR /&gt;(71 . 0)&lt;BR /&gt;(72 . 0)&lt;BR /&gt;(73 . 0)&lt;BR /&gt;(74 . 0)&lt;BR /&gt;(75 . 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine when set to 1.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 19:23:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787476#M94219</guid>
      <dc:creator>dmfrazier</dc:creator>
      <dc:date>2020-10-06T19:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787977#M94220</link>
      <description>&lt;P&gt;Thank you Very Much for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The alternative "O2C-BB" worked for me, but the "Pg2C" I could not wrapped my head around where to place the modification you mentioned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to select multiple objects and then apply the command ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again Thank you for the reply's guys.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 01:14:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9787977#M94220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-07T01:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9789009#M94221</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....The alternative "O2C-BB" worked for me, but the "Pg2C" I could not wrapped my head around where to place the modification you mentioned.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to select multiple objects and then apply the command ?&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Message 3 wasn't suggesting a modification that would need to be placed somewhere, but its Pg2C command &lt;EM&gt;is&lt;/EM&gt;&amp;nbsp; the modification of the code in the link just above it -- it should work as is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are versions of both that will work on &lt;EM&gt;multiple&lt;/EM&gt;&amp;nbsp; Polylines / &lt;EM&gt;multiple&lt;/EM&gt;&amp;nbsp; objects, including with pre-selection [minimally tested]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun C:Pg2C ; = PolyGon-{to}-Circle conversion
  (/ ss n pl verts)
  (if (setq ss (ssget '((0 . "*POLYLINE"))))
    (repeat (setq n (sslength ss)); then
      (setq pl (ssname ss (setq n (1- n))))
      (if (&amp;gt; (setq verts (fix (vlax-curve-getEndParam pl))) 2)
        (progn
          (command "_.circle" "_3P"
            "_none" (vlax-curve-getPointAtParam pl 0)
            "_none" (vlax-curve-getPointAtParam pl (/ verts 3))
            "_none" (vlax-curve-getPointAtParam pl (* (/ verts 3) 2))
          ); command
          (entdel pl)
        ); progn
      ); if
    ); repeat
  ); if
  (princ)
); defun

(defun C:O2C-BB ; = Object {to} Circle based on Bounding Box
  (/ ss n ent LL UR)
  (if (setq ss (ssget))
    (repeat (setq n (sslength ss)); then
      (setq ent (ssname ss (setq n (1- n))))
      (vla-getboundingbox (vlax-ename-&amp;gt;vla-object ent) 'minpt 'maxpt)
      (setq
        LL (vlax-safearray-&amp;gt;list minpt)
        UR (vlax-safearray-&amp;gt;list maxpt)
      ); setq
      (command "_.circle"
        "_none" (mapcar '/ (mapcar '+ LL UR) '(2 2 2)); center
        (/ (distance LL UR) (sqrt 2) 2); radius
      ); command
      (entdel ent)
    ); repeat
  ); if
  (princ)
); defun&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 13:05:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9789009#M94221</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-10-07T13:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Polyline Circle made of many short line segments to normal Circle.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9790310#M94222</link>
      <description>&lt;P&gt;Thank You Good Sir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You helped me save time from individually redrawing a lot of circles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway I can repay you ?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 00:20:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/convert-polyline-circle-made-of-many-short-line-segments-to/m-p/9790310#M94222</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-08T00:20:36Z</dc:date>
    </item>
  </channel>
</rss>

