<?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: Fit Arc Lisp not working in 2017 in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7410631#M114500</link>
    <description>&lt;P&gt;Thanks everybody for the help. I thought it was something to do with the qui osnap.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2017 17:57:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-09-26T17:57:14Z</dc:date>
    <item>
      <title>Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7399812#M114485</link>
      <description>&lt;P&gt;We use a lisp to create an arc tangent to 3 lines and it is not working in 2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have gone through the lisp and from what I understand it does the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(defun c:fa ( / pt1 pt2 pt3 cen ent1 ent2 ent3 pt4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;define functions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setq oldosmode (getvar "OSMODE"))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;save current osmode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setvar "OSMODE" (+ 1024 512))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;set osnap to geometric center and nearest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setq oldhighlight (getvar "HIGHLIGHT"))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;save current highlight mode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setvar "HIGHLIGHT" 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;turn off highlight&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(initget 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;prevents the user from responding to the request by entering only Enter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setq pt1 (getpoint "\nPoint to first line: "))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;prompts user to select a point on the first line and defines that point as pt1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(initget 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;prevents the user from responding to the request by entering only Enter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(setq pt2 (getpoint "\nPoint to second line: "))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;prompts user to select a point on the second line and defines that point as pt2&lt;BR /&gt;(initget 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;prevents the user from responding to the request by entering only Enter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(setq pt3 (getpoint "\nPoint to third line: "))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;prompts user to select a point on the third&amp;nbsp;line and defines that point as pt3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setvar "OSMODE" (+ 1024 256))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;set osnap to geometric center and&amp;nbsp;tangent&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(command "circle" "3p" pt1 pt2 pt3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;draws circle 3 point with tangent osnap to pt1 pt2 and pt3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setvar "OSMODE" 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;turns osnaps off&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setq cen (trans (cdr (assoc 10 (entget (entlast)))) 0 1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;sets &amp;nbsp;cen to the center of the circle just drawn&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(entdel (entlast))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;deletes the circle&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setvar "LASTPOINT" cen)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;sets lastpoint vsystem variable to cen (center of circle drawn and deleted)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;Everything seems to work up to here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setq&lt;BR /&gt;pt1 (osnap pt1 "qui,per")&lt;BR /&gt;pt2 (osnap pt2 "qui,per")&lt;BR /&gt;pt3 (osnap pt3 "qui,per")&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;I think this is supposed to redefine pt1, pt2, and pt3 to points on the lines perpendicular to the center of the circle but i don't think it is working&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(setq&lt;BR /&gt;ent1 (ssget pt1)&lt;BR /&gt;ent2 (ssget pt2)&lt;BR /&gt;ent3 (ssget pt3)&lt;BR /&gt;pt4 (polar pt2 (angle cen pt2) (* 2.0 (distance cen pt2)))&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;this is supposed to define ent1, ent2, and ent3 by selecting the object that passes through pt1, pt2, and pt3 respectively, and then defines pt4 as a point twice the radius of the circle and polar to the angle from the center of the circle to point 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(command "break" ent1 pt1 pt4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;breaks ent1 at pt1 to pt4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(command "break" ent3 pt3 pt4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;breaks ent2 at pt1 to pt4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(command "erase" ent2 "")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;erases ent2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(command "arc" pt1 pt2 pt3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;draws an arc from pt1 through pt2 to pt3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(setvar "HIGHLIGHT" oldhighlight)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;returns highlight to original setting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(setq oldhighlight nil)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;removes oldhighlight value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(setvar "osmode" oldosmode)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;sets osnaps to previous setting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(setq oldosmode nil)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;removes oldosmode value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The lisp routine is below. Can anyone tell me why this isn't working?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;given three lines, arcs or combination thereof, fits an arc tangent&lt;BR /&gt;;to all 3 and trims off excess.&lt;/P&gt;&lt;P&gt;(defun c:fa ( / pt1 pt2 pt3 cen ent1 ent2 ent3 pt4)&lt;BR /&gt;(setq oldosmode (getvar "OSMODE"))&lt;BR /&gt;(setvar "OSMODE" (+ 1024 512))&lt;BR /&gt;(setq oldhighlight (getvar "HIGHLIGHT"))&lt;BR /&gt;(setvar "HIGHLIGHT" 0)&lt;BR /&gt;(initget 1)&lt;BR /&gt;(setq pt1 (getpoint "\nPoint to first line: "))&lt;BR /&gt;(initget 1)&lt;BR /&gt;(setq pt2 (getpoint "\nPoint to second line: "))&lt;BR /&gt;(initget 1)&lt;BR /&gt;(setq pt3 (getpoint "\nPoint to third line: "))&lt;BR /&gt;(setvar "OSMODE" (+ 1024 256))&lt;BR /&gt;(command "circle" "3p" pt1 pt2 pt3)&lt;BR /&gt;(setvar "OSMODE" 0)&lt;BR /&gt;(setq cen (trans (cdr (assoc 10 (entget (entlast)))) 0 1))&lt;BR /&gt;(entdel (entlast))&lt;BR /&gt;(setvar "LASTPOINT" cen)&lt;BR /&gt;(setq&lt;BR /&gt;pt1 (osnap pt1 "qui,per")&lt;BR /&gt;pt2 (osnap pt2 "qui,per")&lt;BR /&gt;pt3 (osnap pt3 "qui,per")&lt;BR /&gt;)&lt;BR /&gt;(setq&lt;BR /&gt;ent1 (ssget pt1)&lt;BR /&gt;ent2 (ssget pt2)&lt;BR /&gt;ent3 (ssget pt3)&lt;BR /&gt;pt4 (polar pt2 (angle cen pt2) (* 2.0 (distance cen pt2)))&lt;BR /&gt;)&lt;BR /&gt;(command "break" ent1 pt1 pt4)&lt;BR /&gt;(command "break" ent3 pt3 pt4)&lt;BR /&gt;(command "erase" ent2 "")&lt;BR /&gt;(command "arc" pt1 pt2 pt3)&lt;BR /&gt;(setvar "HIGHLIGHT" oldhighlight)&lt;BR /&gt;(setq oldhighlight nil)&lt;BR /&gt;(setvar "osmode" oldosmode)&lt;BR /&gt;(setq oldosmode nil)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 21:31:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7399812#M114485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-21T21:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7399898#M114486</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 22:17:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7399898#M114486</guid>
      <dc:creator>rkmcswain</dc:creator>
      <dc:date>2017-09-21T22:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7400394#M114487</link>
      <description>Try to remove qui osnap mode which is no longer supported.</description>
      <pubDate>Fri, 22 Sep 2017 04:42:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7400394#M114487</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2017-09-22T04:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401052#M114488</link>
      <description>&lt;P&gt;Here, I've modified it for you...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;given three lines or rectangular polyline, arcs or combination thereof, fits an arc tangent
;to all 3 and trims off excess.

(defun c:fa ( / *error* oldosmode oldhighlight pt1 pt2 pt3 cen ent1 ent2 ent3 )

  (defun *error* ( m )
    (if oldosmode
      (setvar "OSMODE" oldosmode)
    )
    (if oldhighlight
      (setvar "HIGHLIGHT" oldhighlight)
    )
    (command "_.UNDO" "_E")
    (if m
      (prompt m)
    )
    (princ)
  )

  (command "_.UNDO" "_M")
  (setq oldosmode (getvar "OSMODE"))
  (setvar "OSMODE" 512)
  (setq oldhighlight (getvar "HIGHLIGHT"))
  (setvar "HIGHLIGHT" 0)
  (initget 1)
  (setq pt1 (getpoint "\nPoint to first line: "))
  (initget 1)
  (setq pt2 (getpoint "\nPoint to second line: "))
  (initget 1)
  (setq pt3 (getpoint "\nPoint to third line: "))
  (setvar "OSMODE" 256)
  (command "_.CIRCLE" "_3P" pt1 pt2 pt3)
  (setvar "OSMODE" 0)
  (setq cen (trans (cdr (assoc 10 (entget (entlast)))) 0 1))
  (entdel (entlast))
  (setvar "LASTPOINT" cen)
  (setq
     pt1 (osnap pt1 "per")
     pt2 (osnap pt2 "per")
     pt3 (osnap pt3 "per")
  )
  (setq
     ent1 (ssget pt1)
     ent2 (ssget pt2)
     ent3 (ssget pt3)
  )
  (command "_.BREAK" ent1 pt1 pt2)
  (command "_.BREAK" ent3 pt3 pt2)
  (if (and (not (eq (ssname ent1 0) (ssname ent2 0))) (not (eq (ssname ent2 0) (ssname ent3 0))))
    (command "_.ERASE" ent2 "")
  )
  (command "_.ARC" pt1 pt2 pt3)
  (*error* nil)
)&lt;/PRE&gt;
&lt;P&gt;HTH., M.R.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 09:58:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401052#M114488</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-22T09:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401186#M114489</link>
      <description>&lt;P&gt;...and replace &lt;STRONG&gt;(command) in the *error*&lt;/STRONG&gt; function with (command-s)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 11:05:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401186#M114489</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2017-09-22T11:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401201#M114490</link>
      <description>&lt;P&gt;Yes it's better as it is A2017, but it also works and with just (command) function inside *error* for me...&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 11:10:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401201#M114490</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-22T11:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401302#M114491</link>
      <description>&lt;P&gt;It does not to me. (2018)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case of no error it will go thru (*error* nil) smoothly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in case of error... like picked 3 points with no solution...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;***&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Converting (command) calls to (command-s) is recommended.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or using (command-s)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;***&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Command: _.UNDO Current settings: Auto = On, Control = All, Combine = Yes, Layer = Yes&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] &amp;lt;1&amp;gt;: _E bad argument type: lselsetp nil&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 12:01:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401302#M114491</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2017-09-22T12:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401334#M114492</link>
      <description>&lt;P&gt;Yes, but OP stated that he/she is using A2017... And if you really see something beneficial in (command-s), then I suggest you to test it with some speed test routines... :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:test_command-s_vs_vl-cmdf ( / ti )
  (setq ti (car (_vl-times)))
  (repeat 10000
    (vl-cmdf "_.LINE" "_non" '(0.0 0.0 0.0) "_non" '(0.0 0.0 1.0) "")
  )
  (prompt "\nElapsed time for (vl-cmdf) is : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds...")
  (setq ti (car (_vl-times)))
  (repeat 10000
    (command-s "_.LINE" "_non" '(0.0 0.0 0.0) "_non" '(0.0 0.0 1.0) "")
  )
  (prompt "\nElapsed time for (command-s) is : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds...")
  (princ)
)&lt;/PRE&gt;
&lt;PRE&gt;(defun c:test_vl-cmdf_vs_command ( / ti )
  (setq ti (car (_vl-times)))
  (repeat 10000
    (command "_.LINE" "_non" '(0.0 0.0 0.0) "_non" '(0.0 0.0 1.0) "")
  )
  (prompt "\nElapsed time for (command) is : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds...")
  (setq ti (car (_vl-times)))
  (repeat 10000
    (vl-cmdf "_.LINE" "_non" '(0.0 0.0 0.0) "_non" '(0.0 0.0 1.0) "")
  )
  (prompt "\nElapsed time for (vl-cmdf) is : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds...")
  (princ)
)&lt;/PRE&gt;
&lt;PRE&gt;(defun c:test_command-s_vs_command ( / ti )
  (setq ti (car (_vl-times)))
  (repeat 10000
    (command "_.LINE" "_non" '(0.0 0.0 0.0) "_non" '(0.0 0.0 1.0) "")
  )
  (prompt "\nElapsed time for (command) is : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds...")
  (setq ti (car (_vl-times)))
  (repeat 10000
    (command-s "_.LINE" "_non" '(0.0 0.0 0.0) "_non" '(0.0 0.0 1.0) "")
  )
  (prompt "\nElapsed time for (command-s) is : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds...")
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;My tests showed to me that the best choice is (vl-cmdf)... I don't have A2018 to test it for (*error* nil), but if it passes that, then IMHO (vl-cmdf) is the best... Beside all this, (command-s) is &lt;U&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/U&gt;&lt;STRONG&gt;&lt;/STRONG&gt; supported in earlier versions of AutoCAD... So I didn't made any mistake by putting (command) inside error handler... And I thought speed is here not and issue as OP already used (command) function inside his/her main (c:fa) command function...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 12:20:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401334#M114492</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-22T12:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401428#M114493</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/940934"&gt;@marko_ribar&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes, but OP stated that he/she is using A2017... And if you really see something beneficial in (command-s), then I suggest you to test it with some speed test routines... :&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;I don't prefer command-s at all. I've just pointed out the well-known issue (very likely to you as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; that since version A2015 we should not use the plain (command) in the *error* trap function and use the (command-s) instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See&amp;nbsp;&lt;A href="http://docs.autodesk.com/ACDMAC/2015/ENU/index.html?url=files/GUID-5C9DC003-3DD2-4770-95E7-7E19A4EE19A1.htm,topicNumber=d30e354832" target="_blank"&gt;HERE&lt;/A&gt;&amp;nbsp;for more.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 12:49:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401428#M114493</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2017-09-22T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401915#M114494</link>
      <description>&lt;P&gt;It is not new info for me - I've read it already several times, and I just can't figure out what is improvement in releases A2014+... If there is a difference in logic like it's stated then this can only be something unusual... I mean how can something that necessarily requires single line tokens be better than something that is more flexible in that aspect...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be better :&lt;/P&gt;
&lt;P&gt;(command-s "_.PLINE" "_non" p1 "_non" p2 ... "_non" pn "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Than this :&lt;/P&gt;
&lt;P&gt;(setq ptlst (list p1 p2 ... pn))&lt;/P&gt;
&lt;P&gt;(vl-cmdf "_.PLINE")&lt;/P&gt;
&lt;P&gt;(foreach p ptlst&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (vl-cmdf "_non" p)&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;(vl-cmdf "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or this :&lt;/P&gt;
&lt;P&gt;(setq ptlst (list p1 p2 ... pn))&lt;/P&gt;
&lt;P&gt;(command "_.PLINE")&lt;/P&gt;
&lt;P&gt;(mapcar (function (lambda ( x ) (command "_non" x))) ptlst)&lt;/P&gt;
&lt;P&gt;(command "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the fact that in LISP (List Processing API) we more than often rather use lists (lists of points) than separate variables (point lists) to apply adequate command tokens to...&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 15:20:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401915#M114494</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-22T15:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7402147#M114495</link>
      <description>&lt;P&gt;The improvement, in theory, is that command-s would reject attempts to use the command function interactively within the *errror* function.&amp;nbsp; Vl-cmdf&amp;nbsp;might work.&amp;nbsp; It's also possible just to use other methods, like below.&lt;/P&gt;
&lt;PRE&gt;(defun c:fa (/	      CEN      DOC	ES1	 ES2	  ES3
	     OLDHIGHLIGHT      OLDOSMODE	 PT1	  PT2
	     PT3      PT4
	    )
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (defun *error* (msg)
    (if	msg
      (print msg)
    )
    (mapcar 'setvar
	    '("HIGHLIGHT" "OSMODE")
	    (list oldhighlight oldosmode)
    )
    (vla-EndUndoMark doc)
    (princ)
  )
  (vla-EndUndoMark doc)
  (vla-StartUndoMark doc)
  (setq oldosmode (getvar "OSMODE"))	;save current osmode
  (setvar "OSMODE" (+ 1024 512))	;set osnap to geometric center and nearest
  (setq oldhighlight (getvar "HIGHLIGHT")) ;save current highlight mode
  (setvar "HIGHLIGHT" 0)		;turn off highlight
  (if (and ;;if three objects are selected (no object type filtering)..
	   (setq es1 (entsel "\nPoint to first line: "))
					;prompts user to select a point on the first line and defines that point as pt1
	   (setq es2 (entsel "\nPoint to second line: "))
					;prompts user to select a point on the second line and defines that point as pt2
	   (setq es3 (entsel "\nPoint to third line: "))
					;prompts user to select a point on the third line and defines that point as pt3
      )
    (progn
      (setvar "OSMODE" (+ 1024 256))	;set osnap to geometric center and tangent
      (command "._circle" "_3p" (cadr es1) (cadr es2) (cadr es3))
					;draws circle 3 point with tangent osnap to pt1 pt2 and pt3
      (setvar "OSMODE" 0)		;turns osnaps off
      (setq cen (trans (cdr (assoc 10 (entget (entlast)))) (entlast) 1))
					;sets  cen to the center of the circle just drawn
      (entdel (entlast))		;deletes the circle
      (setvar "LASTPOINT" cen)		;sets lastpoint vsystem variable to cen (center of circle drawn and deleted)
					;Everything seems to work up to here
      (setq
	pt1 (osnap (cadr es1) "_per")	;removed qui, used original pick point
	pt2 (osnap (cadr es2) "_per")	;""
	pt3 (osnap (cadr es3) "_per")	;""
      )
					;changed ssget to (car(entselp...
      (setq
	pt4 (polar pt2 (angle cen pt2) (* 2.0 (distance cen pt2)))
      )
					
      (command "._break" (car es1) pt1 pt4) ;breaks ent1 at pt1 to pt4
      (command "._break" (car es3) pt3 pt4) ;breaks ent3 at pt1 to pt4
      (command "._erase" (car es2) "")	;erases ent2
      (command "._arc" pt1 pt2 pt3)	;draws an arc from pt1 through pt2 to pt3
    )
  )
  (*error* nil)				;Restore variable settings.
)

&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Sep 2017 16:36:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7402147#M114495</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2017-09-22T16:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7402288#M114496</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt; wrote:&lt;BR /&gt;Try to remove qui osnap mode which is no longer supported.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not sure it would solve the problem, but QUIck mode is indeed no longer around [see &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/osmode-1024/m-p/5265709/highlight/true#M325862" target="_blank"&gt;this thread&lt;/A&gt; for some discussion], and it used to be represented by 1024, &lt;EM&gt;before there was&lt;/EM&gt; a geometric-center mode at all. &amp;nbsp;So I would at least suggest removing &lt;EM&gt;both&lt;/EM&gt; the QUI part of those (osnap) functions &lt;EM&gt;and&lt;/EM&gt;&amp;nbsp; the 1024 from&amp;nbsp;the OSMODE setting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it looks to me, in any case, like the resulting Circle &lt;EM&gt;wouldn't&lt;/EM&gt;&amp;nbsp; always be tangent to the Lines, but would be affected by &lt;EM&gt;where you picked&lt;/EM&gt;&amp;nbsp; on them, and therefore its center wouldn't be in quite the right place for locations perpendicular from there to the Lines to be the tangent points of the desired Circle. &amp;nbsp;But I haven't loaded and tested it. &amp;nbsp;Instead of picking the Lines as objects, and going through the shenanigans of drawing a Circle that's sort-of close, finding locations relative to its center and drawing another, you can do the Circle this way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "_.circle" "_3p" "_tan" pause "_tan" pause "_tan" pause)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which not only uses a lot less code but will actually be precisely the Circle you want. &amp;nbsp;I'll leave you to work out the Trimming or Breaking parts, which may be a relatively minor adjustment to the code you already have for that.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:19:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7402288#M114496</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-09-22T17:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7403494#M114497</link>
      <description>&lt;P&gt;Yes, Kent is in right, there were lacks in the code I posted... I've changed it according to what Kent suggested and according to discussed things with (command) functions... It seems that for me now it works well - I've put "_tan" tokens inside that circle call and removed highlight thingy - it's not needed anywhere - also my breaking was bad so I reverted to OP's solution with pt4 variable... To my tests till now I had no problems what ever I've drawn... It also should support polylines...&lt;/P&gt;
&lt;P&gt;Again, correct me if you see something wrong...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;given three lines or rectangular polyline, arcs or combination thereof, fits an arc tangent
;to all 3 and trims off excess.

(defun c:fa ( / *error* adoc oldosmode pt1 pt2 pt3 cen ent1 ent2 ent3 pt4 )

  (vl-load-com)

  (defun *error* ( m )
    (if oldosmode
      (setvar "OSMODE" oldosmode)
    )
    (if adoc
      (vla-endundomark adoc)
    )
    (if m
      (prompt m)
    )
    (princ)
  )

  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (setq oldosmode (getvar "OSMODE"))
  (setvar "OSMODE" 512)
  (initget 1)
  (setq pt1 (getpoint "\nPoint to first line: "))
  (initget 1)
  (setq pt2 (getpoint "\nPoint to second line: "))
  (initget 1)
  (setq pt3 (getpoint "\nPoint to third line: "))
  (vl-cmdf "_.CIRCLE" "_3P" "_tan" pt1 "_tan" pt2 "_tan" pt3)
  (setvar "OSMODE" 0)
  (setq cen (trans (cdr (assoc 10 (entget (entlast)))) (entlast) 1))
  (entdel (entlast))
  (setvar "LASTPOINT" cen)
  (setq
     pt1 (osnap pt1 "_per")
     pt2 (osnap pt2 "_per")
     pt3 (osnap pt3 "_per")
     pt4 (polar cen (angle cen pt2) (* 10 (distance cen pt2)))
  )
  (setq
     ent1 (ssget pt1)
     ent2 (ssget pt2)
     ent3 (ssget pt3)
  )
  (vl-cmdf "_.BREAK" ent1 pt1 pt4)
  (vl-cmdf "_.BREAK" ent3 pt3 pt4)
  (if (and (not (eq (ssname ent1 0) (ssname ent2 0))) (not (eq (ssname ent2 0) (ssname ent3 0))))
    (vl-cmdf "_.ERASE" ent2 "")
  )
  (vl-cmdf "_.ARC" pt1 pt2 pt3)
  (*error* nil)
)&lt;/PRE&gt;
&lt;P&gt;M.R.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 09:24:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7403494#M114497</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-23T09:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7403524#M114498</link>
      <description>&lt;P&gt;Found some more issues at the end of routine... One more revision :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;given three lines or polyline, arcs or combination thereof, fits an arc tangent
;to all 3 and trims off excess.

(defun c:fa ( / *error* adoc oldosmode pt1 pt2 pt3 cen ent1 ent2 ent3 )

  (vl-load-com)

  (defun *error* ( m )
    (if oldosmode
      (setvar "OSMODE" oldosmode)
    )
    (if adoc
      (vla-endundomark adoc)
    )
    (if m
      (prompt m)
    )
    (princ)
  )

  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (setq oldosmode (getvar "OSMODE"))
  (setvar "OSMODE" 512)
  (initget 1)
  (setq pt1 (getpoint "\nPoint to first line: "))
  (initget 1)
  (setq pt2 (getpoint "\nPoint to second line: "))
  (initget 1)
  (setq pt3 (getpoint "\nPoint to third line: "))
  (vl-cmdf "_.CIRCLE" "_3P" "_tan" pt1 "_tan" pt2 "_tan" pt3)
  (setvar "OSMODE" 0)
  (setq cen (trans (cdr (assoc 10 (entget (entlast)))) (entlast) 1))
  (entdel (entlast))
  (setvar "LASTPOINT" cen)
  (setq
     pt1 (osnap pt1 "_per")
     pt2 (osnap pt2 "_per")
     pt3 (osnap pt3 "_per")
  )
  (setq
     ent1 (ssget pt1)
     ent2 (ssget pt2)
     ent3 (ssget pt3)
  )
  (cond
    ( (= (cdr (assoc 0 (entget (ssname ent2 0)))) "LINE")
      (vl-cmdf "_.BREAK" ent1 pt1 (car (vl-sort (list (trans (cdr (assoc 10 (entget (ssname ent1 0)))) 0 1) (trans (cdr (assoc 11 (entget (ssname ent1 0)))) 0 1)) (function (lambda ( a b ) (&amp;lt; (distance pt2 a) (distance pt2 b)))))))
      (vl-cmdf "_.BREAK" ent3 pt3 (car (vl-sort (list (trans (cdr (assoc 10 (entget (ssname ent3 0)))) 0 1) (trans (cdr (assoc 11 (entget (ssname ent3 0)))) 0 1)) (function (lambda ( a b ) (&amp;lt; (distance pt2 a) (distance pt2 b)))))))
      (vl-cmdf "_.ERASE" ent2 "")
    )
    ( t
      (vl-cmdf "_.BREAK" ent1 pt1 pt2)
      (setq ent3 (ssget pt3))
      (vl-cmdf "_.BREAK" ent3 pt2 pt3)
    )
  )
  (vl-cmdf "_.ARC" pt1 pt2 pt3)
  (*error* nil)
)&lt;/PRE&gt;
&lt;P&gt;HTH., M.R.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think now that that's it... Sorry for my blunders...&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 10:29:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7403524#M114498</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-23T10:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7403604#M114499</link>
      <description>&lt;P&gt;One more revision... Only now I saw that you are also combining arcs with straight segments... This mod should work I expect with any combination of those 3 (lines, polylines, arcs)...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;given three lines or polyline or arcs or any combination thereof, fits an arc tangent
;to all 3 and trims off excess.

(defun c:fa ( / *error* adoc oldosmode pt1 pt2 pt3 cen ent1 ent2 ent3 )

  (vl-load-com)

  (defun *error* ( m )
    (if oldosmode
      (setvar "OSMODE" oldosmode)
    )
    (if adoc
      (vla-endundomark adoc)
    )
    (if m
      (prompt m)
    )
    (princ)
  )

  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (setq oldosmode (getvar "OSMODE"))
  (setvar "OSMODE" 512)
  (initget 1)
  (setq pt1 (getpoint "\nPoint to first line: "))
  (initget 1)
  (setq pt2 (getpoint "\nPoint to second line: "))
  (initget 1)
  (setq pt3 (getpoint "\nPoint to third line: "))
  (vl-cmdf "_.CIRCLE" "_3P" "_tan" pt1 "_tan" pt2 "_tan" pt3)
  (setvar "OSMODE" 0)
  (setq cen (trans (cdr (assoc 10 (entget (entlast)))) (entlast) 1))
  (entdel (entlast))
  (setvar "LASTPOINT" cen)
  (setq
     pt1 (osnap pt1 "_per")
     pt2 (osnap pt2 "_per")
     pt3 (osnap pt3 "_per")
  )
  (setq
     ent1 (ssget pt1)
     ent2 (ssget pt2)
     ent3 (ssget pt3)
  )
  (cond
    ( (and (not (eq (ssname ent1 0) (ssname ent2 0))) (not (eq (ssname ent2 0) (ssname ent3 0))))
      (vl-cmdf "_.BREAK" ent1 pt1 (car (vl-sort (list (trans (vlax-curve-getstartpoint (ssname ent1 0)) 0 1) (trans (vlax-curve-getendpoint (ssname ent1 0)) 0 1)) (function (lambda ( a b ) (&amp;lt; (distance pt2 a) (distance pt2 b)))))))
      (vl-cmdf "_.BREAK" ent3 pt3 (car (vl-sort (list (trans (vlax-curve-getstartpoint (ssname ent3 0)) 0 1) (trans (vlax-curve-getendpoint (ssname ent3 0)) 0 1)) (function (lambda ( a b ) (&amp;lt; (distance pt2 a) (distance pt2 b)))))))
      (vl-cmdf "_.ERASE" ent2 "")
    )
    ( (or (not (eq (ssname ent1 0) (ssname ent2 0))) (not (eq (ssname ent2 0) (ssname ent3 0))))
      (vl-cmdf "_.BREAK" ent1 pt1 (car (vl-sort (list (trans (vlax-curve-getstartpoint (ssname ent1 0)) 0 1) (trans (vlax-curve-getendpoint (ssname ent1 0)) 0 1)) (function (lambda ( a b ) (&amp;lt; (distance pt2 a) (distance pt2 b)))))))
      (setq ent3 (ssget pt3))
      (vl-cmdf "_.BREAK" ent3 pt3 (car (vl-sort (list (trans (vlax-curve-getstartpoint (ssname ent3 0)) 0 1) (trans (vlax-curve-getendpoint (ssname ent3 0)) 0 1)) (function (lambda ( a b ) (&amp;lt; (distance pt2 a) (distance pt2 b)))))))
      (vl-cmdf "_.ERASE" (ssget pt2) "")
    )
    ( t
      (vl-cmdf "_.BREAK" ent1 pt1 pt2)
      (setq ent3 (ssget pt3))
      (vl-cmdf "_.BREAK" ent3 pt2 pt3)
    )
  )
  (vl-cmdf "_.ARC" pt1 pt2 pt3)
  (*error* nil)
)&lt;/PRE&gt;
&lt;P&gt;Once again, sorry I am late, but better ever than never...&lt;/P&gt;
&lt;P&gt;M.R.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 12:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7403604#M114499</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-09-23T12:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Arc Lisp not working in 2017</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7410631#M114500</link>
      <description>&lt;P&gt;Thanks everybody for the help. I thought it was something to do with the qui osnap.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 17:57:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7410631#M114500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-26T17:57:14Z</dc:date>
    </item>
  </channel>
</rss>

