<?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: need help with a lisp in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5673122#M325507</link>
    <description>&lt;P&gt;In my opinion it could be more automated... I see 3 scenarios&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1st scenario (as Mleader behavior)&lt;BR /&gt;(setq pt1 (getpoint "Point arrow &amp;lt;exit&amp;gt;: "))&lt;BR /&gt;(setq pt2 (getpoint...&lt;BR /&gt;(setq pt3 (polar p2 0 dist)&lt;BR /&gt;(setq pt4 (polar p2 0 (* dist 2))&lt;BR /&gt;(command "_PLINE" pt3 pt2 pt1 "ARC" "SECOND" PAUSE PAUSE "")&lt;BR /&gt;(command "_TEXT" pt4 ... )&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2st scenario (similar Mleader behavior)&lt;BR /&gt;same as 1st, but pick pt4 to allow user align the text.. and calculate pt2, pt3&lt;/P&gt;
&lt;P&gt;(setq pt1 (getpoint "Point arrow &amp;lt;exit&amp;gt;: "))&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(setq pt4 (getpoint...&lt;/SPAN&gt;&lt;BR /&gt;(setq pt3 (polar p4 PI dist)&lt;BR /&gt;(setq pt2 (polar p4 PI (* dist 2))&lt;BR /&gt;(command "_PLINE" pt3 pt2 pt1 "ARC" "SECOND" PAUSE PAUSE "")&lt;BR /&gt;(command "_TEXT" pt4 )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3st scenario &lt;BR /&gt;add leader to existing text.&lt;BR /&gt;pre/select text (and get its point 10 as pt4)&lt;BR /&gt;(setq pt1 (getpoint "Point arrow: "))&lt;BR /&gt;calculate pt2 and pt3&lt;BR /&gt;(command "_PLINE" pt3 pt2 pt1 "ARC" "SECOND" PAUSE PAUSE "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A question to the OP - Can be an arc loop somehow calculated? Is there some pattern? Or you prefer a user input...&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jun 2015 09:06:02 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2015-06-11T09:06:02Z</dc:date>
    <item>
      <title>need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672255#M325499</link>
      <description>&lt;P&gt;Have a simple routine i wrote for a loop leader. When I am picking point a b c &amp;nbsp;it would be nice to see the line I will be drawing so I could make the landing of the leader straight. Any assistance would be great.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun c:ll ()&lt;BR /&gt;(command "-layer""make""E-ANNO-TEXT""")&lt;BR /&gt;(setq a (getpoint "\nEnter First Point : "))&lt;BR /&gt;(setq b (getpoint "\nEnter Second Point : "))&lt;BR /&gt;(setq c (getpoint "\nEnter third Point : "))&lt;BR /&gt;(command "pLine" a b c "")&lt;BR /&gt;(command "arc""END"PAUSE)&lt;BR /&gt;(princ))&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 16:42:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672255#M325499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-10T16:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672319#M325500</link>
      <description>Is a simple Qleader w/ custom loop arrow block not an option?</description>
      <pubDate>Wed, 10 Jun 2015 17:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672319#M325500</guid>
      <dc:creator>ToanDN</dc:creator>
      <dc:date>2015-06-10T17:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672385#M325501</link>
      <description>&lt;P&gt;no its not an option. The qleader has a block attached to it. this is not a block and the end of the leader can be sized differently. &amp;nbsp;Currently we have a leader head for the quick leader and a leader head for the mleader. I don't want a block at the end .&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:52:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672385#M325501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-10T17:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672478#M325502</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;.... When I am picking point a b c &amp;nbsp;it would be nice to see the line I will be drawing so I could make the landing of the leader straight. ....&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;(setq a (getpoint "\nEnter First Point : "))&lt;BR /&gt;(setq b (getpoint "\nEnter Second Point : "))&lt;BR /&gt;(setq c (getpoint "\nEnter third Point : "))&lt;BR /&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The (getpoint) function has an option for a &lt;FONT color="#FF0000"&gt;[pt]&lt;/FONT&gt; argument, for a point from which it will show a rubber-band indicator.&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(setq a (getpoint "\nEnter First Point : "))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq b (getpoint &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;a&lt;/STRONG&gt;&lt;/FONT&gt; "\nEnter Second Point : "))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq c (getpoint &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;b&lt;/STRONG&gt;&lt;/FONT&gt; "\nEnter third Point : "))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 18:47:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672478#M325502</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-06-10T18:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672510#M325503</link>
      <description>&lt;P&gt;Another way is using the PLINE command directly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;(defun c:LL ( / *error* oCLAYER Layer) 

  (defun *error* (errmsg) ;Error function where program automatically falls when is ERROR or ESC ending
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg)))
    (setvar 'CLAYER oCLAYER) ;returs previous value of sysvar
    (princ)
  )

  (setq oCLAYER (getvar 'CLAYER) ;store sysvar for return
	Layer "E-ANNO-TEXT") 	 ;set name of your layer

  (if (tblsearch "LAYER" Layer) ;if this layer already exists
    (setvar 'CLAYER Layer) 	;set it as current
    (command "_.-LAYER" "_M" Layer "_C" 1 Layer "")) ;otherwise create it.

  (while T  		;END LOOP WITH ESC (if you dont want a loop erase this line)
    (command "_.PLINE" PAUSE PAUSE PAUSE "")
    (command "_.ARC" "_END")
    (while (&amp;gt; (getvar 'CMDACTIVE) 0)
      (command PAUSE))
    ) 			;(if you dont want a loop erase this line)

  (setvar 'CLAYER oCLAYER) 	;not necessary if is a loop
  (princ) 			;not necessary if is a loop 
)&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 19:08:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672510#M325503</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2015-06-10T19:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672612#M325504</link>
      <description>&lt;P&gt;Looking at this in a little more detail, it looks as though the Arc part is supposed to be for an arc &lt;EM&gt;segment&lt;/EM&gt; to end the Polyline with, not an Arc &lt;EM&gt;command&lt;/EM&gt;&amp;nbsp;to make an Arc &lt;EM&gt;entity&lt;/EM&gt;. &amp;nbsp;[If there's an End option in the first prompt in Arc in newer versions than mine here, which &lt;EM&gt;doesn't&lt;/EM&gt; have that option until later, you certainly can't complete the Arc with only &lt;EM&gt;one&lt;/EM&gt; subsequent Pause for input.] &amp;nbsp;If that's the case, then this part of the original:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "pLine" a b c "")&lt;FONT color="#33CCCC"&gt;; that last "" ends the Polyline, making the next line of code an Arc &lt;EM&gt;command&lt;/EM&gt;, not a Polyline arc-segment option&lt;/FONT&gt;&lt;BR /&gt;(command "arc""END" PAUSE)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;should be re-arranged:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "pLine" a b c "arc" "END" PAUSE&amp;nbsp;"")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the suggestion to just do it all &lt;EM&gt;inside&lt;/EM&gt; a Polyline command, rather than ask for points first, should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "_.PLINE" PAUSE PAUSE PAUSE "_ARC" "_END" "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[note the &lt;EM&gt;lack&lt;/EM&gt; of period/decimal with Arc, since it's&amp;nbsp;an &lt;EM&gt;option&lt;/EM&gt; rather than a &lt;EM&gt;command&lt;/EM&gt; name for which the period/decimal would be appropriate].&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 20:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672612#M325504</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-06-10T20:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672631#M325505</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;
&lt;P&gt;Another way is using the PLINE command directly:&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I was thinking about suggesting that, but I &lt;EM&gt;can&lt;/EM&gt; think of a reason they might prefer to do it with (getpoint) functions asking for points first. &amp;nbsp;Doing it &lt;EM&gt;within&lt;/EM&gt; a PLINE command and with "raw" Pauses leaves it subject to the possibility that a User might choose to call for one of the &lt;EM&gt;options&lt;/EM&gt; in the Pline prompt that would be there in front of them&amp;nbsp;[width, arc, etc.], not perhaps knowing that their number of inputs is strictly limited. &amp;nbsp;Asking for the points first guarantees that the Polyline will be built starting with two straight segments, with the arc segment following to end it [if the&amp;nbsp;interpretation in my previous Reply was correct], since Users will &lt;EM&gt;not&lt;/EM&gt; have those other options presented to them. &amp;nbsp;The OP would need to decide what's preferable to them.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 20:23:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672631#M325505</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-06-10T20:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672819#M325506</link>
      <description>I'm thinking Kent is on the right tract with your inquiry.&lt;BR /&gt;I would suggest structuring your program to take advantage&lt;BR /&gt;of the Ortho switching and TEST user input before proceeding.&lt;BR /&gt;&lt;BR /&gt;(setvar 'ORTHOMODE 1)&lt;BR /&gt;(setq a (getpoint...&lt;BR /&gt;(setq b (getpoint...&lt;BR /&gt;(setvar 'ORTHOMODE 0)&lt;BR /&gt;(if (and a b (setq c (getpoint...&lt;BR /&gt; (progn&lt;BR /&gt; [layermake, pline and arc goes here]&lt;BR /&gt; );progn&lt;BR /&gt;);if&lt;BR /&gt;&lt;BR /&gt;I also see that running snaps are not suppressed.&lt;BR /&gt;This may be an issue when not very close.&lt;BR /&gt;Once past the user test of proper input, suppress OSMODE when drawing and restore when finished.&lt;BR /&gt;&lt;BR /&gt;???&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Jun 2015 22:50:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5672819#M325506</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2015-06-10T22:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: need help with a lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5673122#M325507</link>
      <description>&lt;P&gt;In my opinion it could be more automated... I see 3 scenarios&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1st scenario (as Mleader behavior)&lt;BR /&gt;(setq pt1 (getpoint "Point arrow &amp;lt;exit&amp;gt;: "))&lt;BR /&gt;(setq pt2 (getpoint...&lt;BR /&gt;(setq pt3 (polar p2 0 dist)&lt;BR /&gt;(setq pt4 (polar p2 0 (* dist 2))&lt;BR /&gt;(command "_PLINE" pt3 pt2 pt1 "ARC" "SECOND" PAUSE PAUSE "")&lt;BR /&gt;(command "_TEXT" pt4 ... )&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2st scenario (similar Mleader behavior)&lt;BR /&gt;same as 1st, but pick pt4 to allow user align the text.. and calculate pt2, pt3&lt;/P&gt;
&lt;P&gt;(setq pt1 (getpoint "Point arrow &amp;lt;exit&amp;gt;: "))&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(setq pt4 (getpoint...&lt;/SPAN&gt;&lt;BR /&gt;(setq pt3 (polar p4 PI dist)&lt;BR /&gt;(setq pt2 (polar p4 PI (* dist 2))&lt;BR /&gt;(command "_PLINE" pt3 pt2 pt1 "ARC" "SECOND" PAUSE PAUSE "")&lt;BR /&gt;(command "_TEXT" pt4 )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3st scenario &lt;BR /&gt;add leader to existing text.&lt;BR /&gt;pre/select text (and get its point 10 as pt4)&lt;BR /&gt;(setq pt1 (getpoint "Point arrow: "))&lt;BR /&gt;calculate pt2 and pt3&lt;BR /&gt;(command "_PLINE" pt3 pt2 pt1 "ARC" "SECOND" PAUSE PAUSE "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A question to the OP - Can be an arc loop somehow calculated? Is there some pattern? Or you prefer a user input...&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2015 09:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/need-help-with-a-lisp/m-p/5673122#M325507</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2015-06-11T09:06:02Z</dc:date>
    </item>
  </channel>
</rss>

