<?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: in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828670#M160689</link>
    <description>This creates both parts on layer 53 for me:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "._layer" "_s" "53" "")&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
This creates the leader on 53 and the Mtext on layer 0:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "._layer" "_m" "53" "")&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
And so does this does this:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer s1b)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "._layer" "_m" "53" "")&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
  (setq s1b (entget (entlast)))&lt;BR /&gt;
  (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
  (entmod s1b)&lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
However, after completing the dl program, you can run:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dla (/ s1b)&lt;BR /&gt;
  (setq s1b (entget (entlast)))&lt;BR /&gt;
  (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
  (entmod s1b)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
And the Mtext will be on layer 53.  I even tried dla as a subroutine, but&lt;BR /&gt;
to no avail.  It seems that you must be returned to the command prompt&lt;BR /&gt;
after using Mtext before any modifications are valid.&lt;BR /&gt;
--&lt;BR /&gt;
Dave D&lt;BR /&gt;
&lt;BR /&gt;
R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;lt;877584$l0d21@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; Are you sure about the "set" Dave? I still get their error. You are&lt;BR /&gt;
correct&lt;BR /&gt;
&amp;gt; about the (initdia), I never thought about removing it.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt;&lt;/NOT.ROBERTB&gt;</description>
    <pubDate>Tue, 01 Feb 2000 21:15:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2000-02-01T21:15:44Z</dc:date>
    <item>
      <title>QLeader Command Customization Help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828661#M160680</link>
      <description>Could somebody take a look at this macro and tell me what I've got wrong?&lt;BR /&gt;
I'm trying to make it so that when you type "DL", the current layer will&lt;BR /&gt;
switch to "53", continue the qleader command, and then at the end, switch&lt;BR /&gt;
back to whatever was the previous current layer. As it is, the lisp doesn't&lt;BR /&gt;
work right, and I lack the knowledge to finish it.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any help,&lt;BR /&gt;
Robert Asher&lt;BR /&gt;
George Butler Associates, Inc.&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer qleader)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "layer" "s" "53" "")&lt;BR /&gt;
  (initdia)&lt;BR /&gt;
  (command "_qleader")&lt;BR /&gt;
      (while (= (logand (getvar "cmdactive") 1) 1)&lt;BR /&gt;
            (command pause)&lt;BR /&gt;
      )&lt;BR /&gt;
   (setvar "clayer" clayer)&lt;BR /&gt;
   (princ)&lt;BR /&gt;
)</description>
      <pubDate>Mon, 31 Jan 2000 16:42:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828661#M160680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-31T16:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: QLeader Command Customization Help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828662#M160681</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Under AC2K (I'm assuming here, please post that &lt;BR /&gt;
information next time) you do not need the (while) loop, due to the use of &lt;BR /&gt;
(initdia). So here is your revised routine. The green lines (commented) lines &lt;BR /&gt;
should just be deleted. You do not need the qleader variable declaration (you &lt;BR /&gt;
are not using a qleader variable!).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer &lt;FONT&gt;&lt;BR /&gt;
color=#008000&amp;gt;qleader&lt;/FONT&gt;)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA Text Leader\n")&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
(setq clayer (getvar "clayer"))&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; (command "._layer" &lt;BR /&gt;
"_m" "53" "")&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (initdia)&lt;BR /&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;(command &lt;BR /&gt;
"._qleader")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;FONT&gt;&lt;BR /&gt;
color=#008000&amp;gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar &lt;BR /&gt;
"cmdactive") 1) &lt;BR /&gt;
1)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
(command pause)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&amp;nbsp; (setvar &lt;BR /&gt;
"clayer" clayer)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I changed the "layer" "s" to "layer" "m", to make &lt;BR /&gt;
the layer. if it does not exist. Of course, it would be white in that case, but &lt;BR /&gt;
at least the routine would not bomb!&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network &lt;BR /&gt;
Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." in my address for &lt;BR /&gt;
direct e-mail)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Robert Asher &amp;lt;&lt;A&gt;&lt;BR /&gt;
href="mailto:rasher@gbutler.com"&amp;gt;rasher@gbutler.com&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
href="news:874efs$csc7@adesknews2.autodesk.com"&amp;gt;news:874efs$csc7@adesknews2.autodesk.com&lt;/A&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT&gt;&lt;BR /&gt;
face=Arial size=2&amp;gt;&amp;gt; Could somebody take a look at this macro and tell me what &lt;BR /&gt;
I've got wrong?&lt;BR /&gt;&amp;gt; I'm trying to make it so that when you type "DL", the &lt;BR /&gt;
current layer will&lt;BR /&gt;&amp;gt; switch to "53", continue the qleader command, and &lt;BR /&gt;
then at the end, switch&lt;BR /&gt;&amp;gt; back to whatever was the previous current layer. &lt;BR /&gt;
As it is, the lisp doesn't&lt;BR /&gt;&amp;gt; work right, and I lack the knowledge to &lt;BR /&gt;
finish it.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; Thanks for any help,&lt;BR /&gt;&amp;gt; Robert Asher&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
George Butler Associates, Inc.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; (defun c:dl ( / clayer &lt;BR /&gt;
qleader)&lt;BR /&gt;&amp;gt; &amp;nbsp; (prompt "\nGBA Text Leader\n")&lt;BR /&gt;&amp;gt; &amp;nbsp; (setq &lt;BR /&gt;
clayer (getvar "clayer"))&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "layer" "s" "53" "")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
&amp;nbsp; (initdia)&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "_qleader")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar "cmdactive") 1) &lt;BR /&gt;
1)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
(command pause)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; &lt;BR /&gt;
(setvar "clayer" clayer)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;gt; )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;
&lt;/FONT&gt;</description>
      <pubDate>Mon, 31 Jan 2000 17:52:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828662#M160681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-31T17:52:16Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828663#M160682</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; This routine results in the&amp;nbsp;leader line &lt;BR /&gt;
being created on the "53" layer but the text ends up on the layer stored in &lt;BR /&gt;
"clayer".&amp;nbsp; The initdia of course doesn't have any affect on the first part &lt;BR /&gt;
of the qleader command that draws the line, and lapses before the actual mtext &lt;BR /&gt;
prompt comes up, resulting in the mtext being entered on the command &lt;BR /&gt;
line.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; I tried working out this problem myself a &lt;BR /&gt;
few weeks ago on AC2K and never could get it to work right.&amp;nbsp; Is there a way &lt;BR /&gt;
to modify it so that the text comes in on the same layer as the leader and still &lt;BR /&gt;
have the routine switch back to the previously current layer when it's &lt;BR /&gt;
done?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
wrote in message &lt;A&gt;&lt;BR /&gt;
href="news:874i4v$d659@adesknews2.autodesk.com"&amp;gt;news:874i4v$d659@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Under AC2K (I'm assuming here, please post that &lt;BR /&gt;
  information next time) you do not need the (while) loop, due to the use of &lt;BR /&gt;
  (initdia). So here is your revised routine. The green lines (commented) lines &lt;BR /&gt;
  should just be deleted. You do not need the qleader variable declaration (you &lt;BR /&gt;
  are not using a qleader variable!).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer &lt;FONT&gt;&lt;BR /&gt;
  color=#008000&amp;gt;qleader&lt;/FONT&gt;)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA Text &lt;BR /&gt;
  Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar "clayer"))&lt;BR /&gt;&lt;FONT&gt;&lt;BR /&gt;
  color=#ff0000&amp;gt;&amp;nbsp; (command "._layer" "_m" "53" "")&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  (initdia)&lt;BR /&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;(command &lt;BR /&gt;
  "._qleader")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;FONT&gt;&lt;BR /&gt;
  color=#008000&amp;gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar &lt;BR /&gt;
  "cmdactive") 1) &lt;BR /&gt;
  1)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  (command pause)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&amp;nbsp; &lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I changed the "layer" "s" to "layer" "m", to make &lt;BR /&gt;
  the layer. if it does not exist. Of course, it would be white in that case, &lt;BR /&gt;
  but at least the routine would not bomb!&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, &lt;BR /&gt;
  MCSE&lt;BR /&gt;Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." in &lt;BR /&gt;
  my address for direct e-mail)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Robert Asher &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:rasher@gbutler.com"&amp;gt;rasher@gbutler.com&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
  &lt;A&gt;&lt;BR /&gt;
  href="news:874efs$csc7@adesknews2.autodesk.com"&amp;gt;news:874efs$csc7@adesknews2.autodesk.com&lt;/A&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT&gt;&lt;BR /&gt;
  face=Arial size=2&amp;gt;&amp;gt; Could somebody take a look at this macro and tell me &lt;BR /&gt;
  what I've got wrong?&lt;BR /&gt;&amp;gt; I'm trying to make it so that when you type "DL", &lt;BR /&gt;
  the current layer will&lt;BR /&gt;&amp;gt; switch to "53", continue the qleader command, &lt;BR /&gt;
  and then at the end, switch&lt;BR /&gt;&amp;gt; back to whatever was the previous current &lt;BR /&gt;
  layer. As it is, the lisp doesn't&lt;BR /&gt;&amp;gt; work right, and I lack the knowledge &lt;BR /&gt;
  to finish it.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; Thanks for any help,&lt;BR /&gt;&amp;gt; Robert &lt;BR /&gt;
  Asher&lt;BR /&gt;&amp;gt; George Butler Associates, Inc.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; (defun &lt;BR /&gt;
  c:dl ( / clayer qleader)&lt;BR /&gt;&amp;gt; &amp;nbsp; (prompt "\nGBA Text Leader\n")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
  &amp;nbsp; (setq clayer (getvar "clayer"))&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "layer" "s" &lt;BR /&gt;
  "53" "")&lt;BR /&gt;&amp;gt; &amp;nbsp; (initdia)&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "_qleader")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar "cmdactive") 1) &lt;BR /&gt;
  1)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  (command pause)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;gt; )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
  &lt;BR /&gt;&amp;gt; &lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2000 14:19:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828663#M160682</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T14:19:54Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828664#M160683</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;With a wave of my magic wand . . .&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA &lt;BR /&gt;
Text Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar "CLayer"))&lt;BR /&gt;&amp;nbsp; (command &lt;BR /&gt;
"._layer" "_m" "53" "")&lt;BR /&gt;&amp;nbsp; (initdia)&lt;BR /&gt;&amp;nbsp; (command &lt;BR /&gt;
"._qleader")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (while (not (wcmatch (getvar "LastPrompt") "Specify &lt;BR /&gt;
text width*"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command pause)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
(command (getstring "\nEnter first line of annotation text &amp;lt;Mtext&amp;gt;: &lt;BR /&gt;
"))&lt;BR /&gt;&amp;nbsp; (setvar "CLayer" clayer)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;-- &lt;BR /&gt;
&lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network Administrator (or, Modern-day &lt;BR /&gt;
Wizard)&lt;BR /&gt;(remove the "not." in my address for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:876pua$i9a22@adesknews2.autodesk.com"&amp;gt;news:876pua$i9a22@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; This routine results in the&amp;nbsp;leader &lt;BR /&gt;
  line being created on the "53" layer but the text ends up on the layer stored &lt;BR /&gt;
  in "clayer".&amp;nbsp; The initdia of course doesn't have any affect on the first &lt;BR /&gt;
  part of the qleader command that draws the line, and lapses before the actual &lt;BR /&gt;
  mtext prompt comes up, resulting in the mtext being entered on the command &lt;BR /&gt;
  line.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; I tried working out this problem myself a &lt;BR /&gt;
  few weeks ago on AC2K and never could get it to work right.&amp;nbsp; Is there a &lt;BR /&gt;
  way to modify it so that the text comes in on the same layer as the leader and &lt;BR /&gt;
  still have the routine switch back to the previously current layer when it's &lt;BR /&gt;
  done?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:874i4v$d659@adesknews2.autodesk.com"&amp;gt;news:874i4v$d659@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Under AC2K (I'm assuming here, please post that &lt;BR /&gt;
    information next time) you do not need the (while) loop, due to the use of &lt;BR /&gt;
    (initdia). So here is your revised routine. The green lines (commented) &lt;BR /&gt;
    lines should just be deleted. You do not need the qleader variable &lt;BR /&gt;
    declaration (you are not using a qleader variable!).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer &lt;FONT&gt;&lt;BR /&gt;
    color=#008000&amp;gt;qleader&lt;/FONT&gt;)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA Text &lt;BR /&gt;
    Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar "clayer"))&lt;BR /&gt;&lt;FONT&gt;&lt;BR /&gt;
    color=#ff0000&amp;gt;&amp;nbsp; (command "._layer" "_m" "53" "")&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
    (initdia)&lt;BR /&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;(command &lt;BR /&gt;
    "._qleader")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;FONT&gt;&lt;BR /&gt;
    color=#008000&amp;gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar &lt;BR /&gt;
    "cmdactive") 1) &lt;BR /&gt;
    1)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
    (command pause)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&amp;nbsp; &lt;BR /&gt;
    (setvar "clayer" clayer)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I changed the "layer" "s" to "layer" "m", to &lt;BR /&gt;
    make the layer. if it does not exist. Of course, it would be white in that &lt;BR /&gt;
    case, but at least the routine would not bomb!&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, &lt;BR /&gt;
    MCSE&lt;BR /&gt;Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." &lt;BR /&gt;
    in my address for direct e-mail)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Robert Asher &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:rasher@gbutler.com"&amp;gt;rasher@gbutler.com&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
    &lt;A&gt;&lt;BR /&gt;
    href="news:874efs$csc7@adesknews2.autodesk.com"&amp;gt;news:874efs$csc7@adesknews2.autodesk.com&lt;/A&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT&gt;&lt;BR /&gt;
    face=Arial size=2&amp;gt;&amp;gt; Could somebody take a look at this macro and tell me &lt;BR /&gt;
    what I've got wrong?&lt;BR /&gt;&amp;gt; I'm trying to make it so that when you type &lt;BR /&gt;
    "DL", the current layer will&lt;BR /&gt;&amp;gt; switch to "53", continue the qleader &lt;BR /&gt;
    command, and then at the end, switch&lt;BR /&gt;&amp;gt; back to whatever was the &lt;BR /&gt;
    previous current layer. As it is, the lisp doesn't&lt;BR /&gt;&amp;gt; work right, and I &lt;BR /&gt;
    lack the knowledge to finish it.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; Thanks for any &lt;BR /&gt;
    help,&lt;BR /&gt;&amp;gt; Robert Asher&lt;BR /&gt;&amp;gt; George Butler Associates, Inc.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
    &lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; (defun c:dl ( / clayer qleader)&lt;BR /&gt;&amp;gt; &amp;nbsp; (prompt &lt;BR /&gt;
    "\nGBA Text Leader\n")&lt;BR /&gt;&amp;gt; &amp;nbsp; (setq clayer (getvar &lt;BR /&gt;
    "clayer"))&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "layer" "s" "53" "")&lt;BR /&gt;&amp;gt; &amp;nbsp; &lt;BR /&gt;
    (initdia)&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "_qleader")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar "cmdactive") 1) &lt;BR /&gt;
    1)&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command &lt;BR /&gt;
    pause)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; (setvar &lt;BR /&gt;
    "clayer" clayer)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;gt; )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;
    &lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2000 16:49:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828664#M160683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T16:49:36Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828665#M160684</link>
      <description>Well, now that's a strange one. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
The only thing that thwarted your last offering was the fact that you were&lt;BR /&gt;
"making" the layer.  When "setting" the layer, it places the Leader and the&lt;BR /&gt;
Mtext on the "set" layer.  Initdia seems to have no effect.&lt;BR /&gt;
&lt;BR /&gt;
A strange twist, to be sure.  Perhaps it's another one of those "features."&lt;BR /&gt;
 &lt;G&gt;&lt;BR /&gt;
--&lt;BR /&gt;
Dave D&lt;BR /&gt;
&lt;BR /&gt;
R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;lt;8772rm$ks613@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
With a wave of my magic wand . . .&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "CLayer"))&lt;BR /&gt;
  (command "._layer" "_m" "53" "")&lt;BR /&gt;
  (initdia)&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
   (while (not (wcmatch (getvar "LastPrompt") "Specify text width*"))&lt;BR /&gt;
    (command pause)&lt;BR /&gt;
   )&lt;BR /&gt;
  (command (getstring "\nEnter first line of annotation text &lt;MTEXT&gt;: "))&lt;BR /&gt;
  (setvar "CLayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
(remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&lt;BR /&gt;
  DBlaha &lt;DBLAHA&gt; wrote in message&lt;BR /&gt;
news:876pua$i9a22@adesknews2.autodesk.com...&lt;BR /&gt;
    This routine results in the leader line being created on the "53" layer&lt;BR /&gt;
but the text ends up on the layer stored in "clayer".  The initdia of&lt;BR /&gt;
course doesn't have any affect on the first part of the qleader command&lt;BR /&gt;
that draws the line, and lapses before the actual mtext prompt comes up,&lt;BR /&gt;
resulting in the mtext being entered on the command line.&lt;BR /&gt;
    I tried working out this problem myself a few weeks ago on AC2K and&lt;BR /&gt;
never could get it to work right.  Is there a way to modify it so that the&lt;BR /&gt;
text comes in on the same layer as the leader and still have the routine&lt;BR /&gt;
switch back to the previously current layer when it's done?&lt;BR /&gt;
&lt;BR /&gt;
  Dave&lt;BR /&gt;
&lt;BR /&gt;
  R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
news:874i4v$d659@adesknews2.autodesk.com...&lt;BR /&gt;
    Under AC2K (I'm assuming here, please post that information next time)&lt;BR /&gt;
you do not need the (while) loop, due to the use of (initdia). So here is&lt;BR /&gt;
your revised routine. The green lines (commented) lines should just be&lt;BR /&gt;
deleted. You do not need the qleader variable declaration (you are not&lt;BR /&gt;
using a qleader variable!).&lt;BR /&gt;
&lt;BR /&gt;
    (defun c:dl ( / clayer qleader)&lt;BR /&gt;
      (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
      (setq clayer (getvar "clayer"))&lt;BR /&gt;
      (command "._layer" "_m" "53" "")&lt;BR /&gt;
      (initdia)&lt;BR /&gt;
      (command "._qleader")&lt;BR /&gt;
    ;;;      (while (= (logand (getvar "cmdactive") 1) 1)&lt;BR /&gt;
    ;;;            (command pause)&lt;BR /&gt;
    ;;;      )&lt;BR /&gt;
      (setvar "clayer" clayer)&lt;BR /&gt;
      (princ)&lt;BR /&gt;
    )&lt;BR /&gt;
&lt;BR /&gt;
    I changed the "layer" "s" to "layer" "m", to make the layer. if it does&lt;BR /&gt;
not exist. Of course, it would be white in that case, but at least the&lt;BR /&gt;
routine would not bomb!&lt;BR /&gt;
    -- &lt;BR /&gt;
    R. Robert Bell, MCSE&lt;BR /&gt;
    Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
    (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&lt;BR /&gt;
    Robert Asher &lt;RASHER&gt; wrote in message&lt;BR /&gt;
news:874efs$csc7@adesknews2.autodesk.com...&lt;BR /&gt;
    &amp;gt; Could somebody take a look at this macro and tell me what I've got&lt;BR /&gt;
wrong?&lt;BR /&gt;
    &amp;gt; I'm trying to make it so that when you type "DL", the current layer&lt;BR /&gt;
will&lt;BR /&gt;
    &amp;gt; switch to "53", continue the qleader command, and then at the end,&lt;BR /&gt;
switch&lt;BR /&gt;
    &amp;gt; back to whatever was the previous current layer. As it is, the lisp&lt;BR /&gt;
doesn't&lt;BR /&gt;
    &amp;gt; work right, and I lack the knowledge to finish it.&lt;BR /&gt;
    &amp;gt; &lt;BR /&gt;
    &amp;gt; Thanks for any help,&lt;BR /&gt;
    &amp;gt; Robert Asher&lt;BR /&gt;
    &amp;gt; George Butler Associates, Inc.&lt;BR /&gt;
    &amp;gt; &lt;BR /&gt;
    &amp;gt; &lt;BR /&gt;
    &amp;gt; (defun c:dl ( / clayer qleader)&lt;BR /&gt;
    &amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
    &amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
    &amp;gt;   (command "layer" "s" "53" "")&lt;BR /&gt;
    &amp;gt;   (initdia)&lt;BR /&gt;
    &amp;gt;   (command "_qleader")&lt;BR /&gt;
    &amp;gt;       (while (= (logand (getvar "cmdactive") 1) 1)&lt;BR /&gt;
    &amp;gt;             (command pause)&lt;BR /&gt;
    &amp;gt;       )&lt;BR /&gt;
    &amp;gt;    (setvar "clayer" clayer)&lt;BR /&gt;
    &amp;gt;    (princ)&lt;BR /&gt;
    &amp;gt; )&lt;BR /&gt;
    &amp;gt; &lt;BR /&gt;
    &amp;gt; &lt;BR /&gt;
&lt;BR /&gt;
----------&lt;/RASHER&gt;&lt;/NOT.ROBERTB&gt;&lt;/DBLAHA&gt;&lt;/MTEXT&gt;&lt;/NOT.ROBERTB&gt;&lt;/G&gt;</description>
      <pubDate>Tue, 01 Feb 2000 17:08:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828665#M160684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T17:08:15Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828666#M160685</link>
      <description>Are you sure about the "set" Dave? I still get their error. You are correct&lt;BR /&gt;
about the (initdia), I never thought about removing it.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
(remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&lt;BR /&gt;
David Doane &lt;LECTRO-MECH&gt; wrote in message&lt;BR /&gt;
news:01bf6cd6$d8534440$7657d2d0@lms-1...&lt;BR /&gt;
&amp;gt; Well, now that's a strange one. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; The only thing that thwarted your last offering was the fact that you were&lt;BR /&gt;
&amp;gt; "making" the layer.  When "setting" the layer, it places the Leader and&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; Mtext on the "set" layer.  Initdia seems to have no effect.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; A strange twist, to be sure.  Perhaps it's another one of those&lt;BR /&gt;
"features."&lt;BR /&gt;
&amp;gt;  &lt;G&gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Dave D&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;gt; &amp;lt;8772rm$ks613@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; With a wave of my magic wand . . .&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun c:dl ( / clayer)&lt;BR /&gt;
&amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt;   (setq clayer (getvar "CLayer"))&lt;BR /&gt;
&amp;gt;   (command "._layer" "_m" "53" "")&lt;BR /&gt;
&amp;gt;   (initdia)&lt;BR /&gt;
&amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt;    (while (not (wcmatch (getvar "LastPrompt") "Specify text width*"))&lt;BR /&gt;
&amp;gt;     (command pause)&lt;BR /&gt;
&amp;gt;    )&lt;BR /&gt;
&amp;gt;   (command (getstring "\nEnter first line of annotation text &lt;MTEXT&gt;: "))&lt;BR /&gt;
&amp;gt;   (setvar "CLayer" clayer)&lt;BR /&gt;
&amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   DBlaha &lt;DBLAHA&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:876pua$i9a22@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt;     This routine results in the leader line being created on the "53"&lt;BR /&gt;
layer&lt;BR /&gt;
&amp;gt; but the text ends up on the layer stored in "clayer".  The initdia of&lt;BR /&gt;
&amp;gt; course doesn't have any affect on the first part of the qleader command&lt;BR /&gt;
&amp;gt; that draws the line, and lapses before the actual mtext prompt comes up,&lt;BR /&gt;
&amp;gt; resulting in the mtext being entered on the command line.&lt;BR /&gt;
&amp;gt;     I tried working out this problem myself a few weeks ago on AC2K and&lt;BR /&gt;
&amp;gt; never could get it to work right.  Is there a way to modify it so that the&lt;BR /&gt;
&amp;gt; text comes in on the same layer as the leader and still have the routine&lt;BR /&gt;
&amp;gt; switch back to the previously current layer when it's done?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   Dave&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:874i4v$d659@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt;     Under AC2K (I'm assuming here, please post that information next time)&lt;BR /&gt;
&amp;gt; you do not need the (while) loop, due to the use of (initdia). So here is&lt;BR /&gt;
&amp;gt; your revised routine. The green lines (commented) lines should just be&lt;BR /&gt;
&amp;gt; deleted. You do not need the qleader variable declaration (you are not&lt;BR /&gt;
&amp;gt; using a qleader variable!).&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     (defun c:dl ( / clayer qleader)&lt;BR /&gt;
&amp;gt;       (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt;       (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt;       (command "._layer" "_m" "53" "")&lt;BR /&gt;
&amp;gt;       (initdia)&lt;BR /&gt;
&amp;gt;       (command "._qleader")&lt;BR /&gt;
&amp;gt;     ;;;      (while (= (logand (getvar "cmdactive") 1) 1)&lt;BR /&gt;
&amp;gt;     ;;;            (command pause)&lt;BR /&gt;
&amp;gt;     ;;;      )&lt;BR /&gt;
&amp;gt;       (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt;       (princ)&lt;BR /&gt;
&amp;gt;     )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     I changed the "layer" "s" to "layer" "m", to make the layer. if it&lt;BR /&gt;
does&lt;BR /&gt;
&amp;gt; not exist. Of course, it would be white in that case, but at least the&lt;BR /&gt;
&amp;gt; routine would not bomb!&lt;BR /&gt;
&amp;gt;     --&lt;BR /&gt;
&amp;gt;     R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt;     Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt;     (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Robert Asher &lt;RASHER&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:874efs$csc7@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt;     &amp;gt; Could somebody take a look at this macro and tell me what I've got&lt;BR /&gt;
&amp;gt; wrong?&lt;BR /&gt;
&amp;gt;     &amp;gt; I'm trying to make it so that when you type "DL", the current layer&lt;BR /&gt;
&amp;gt; will&lt;BR /&gt;
&amp;gt;     &amp;gt; switch to "53", continue the qleader command, and then at the end,&lt;BR /&gt;
&amp;gt; switch&lt;BR /&gt;
&amp;gt;     &amp;gt; back to whatever was the previous current layer. As it is, the lisp&lt;BR /&gt;
&amp;gt; doesn't&lt;BR /&gt;
&amp;gt;     &amp;gt; work right, and I lack the knowledge to finish it.&lt;BR /&gt;
&amp;gt;     &amp;gt;&lt;BR /&gt;
&amp;gt;     &amp;gt; Thanks for any help,&lt;BR /&gt;
&amp;gt;     &amp;gt; Robert Asher&lt;BR /&gt;
&amp;gt;     &amp;gt; George Butler Associates, Inc.&lt;BR /&gt;
&amp;gt;     &amp;gt;&lt;BR /&gt;
&amp;gt;     &amp;gt;&lt;BR /&gt;
&amp;gt;     &amp;gt; (defun c:dl ( / clayer qleader)&lt;BR /&gt;
&amp;gt;     &amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt;     &amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt;     &amp;gt;   (command "layer" "s" "53" "")&lt;BR /&gt;
&amp;gt;     &amp;gt;   (initdia)&lt;BR /&gt;
&amp;gt;     &amp;gt;   (command "_qleader")&lt;BR /&gt;
&amp;gt;     &amp;gt;       (while (= (logand (getvar "cmdactive") 1) 1)&lt;BR /&gt;
&amp;gt;     &amp;gt;             (command pause)&lt;BR /&gt;
&amp;gt;     &amp;gt;       )&lt;BR /&gt;
&amp;gt;     &amp;gt;    (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt;     &amp;gt;    (princ)&lt;BR /&gt;
&amp;gt;     &amp;gt; )&lt;BR /&gt;
&amp;gt;     &amp;gt;&lt;BR /&gt;
&amp;gt;     &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ----------&lt;BR /&gt;
&amp;gt;&lt;/RASHER&gt;&lt;/NOT.ROBERTB&gt;&lt;/DBLAHA&gt;&lt;/MTEXT&gt;&lt;/NOT.ROBERTB&gt;&lt;/G&gt;&lt;/LECTRO-MECH&gt;</description>
      <pubDate>Tue, 01 Feb 2000 17:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828666#M160685</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T17:30:25Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828667#M160686</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;This routine works&amp;nbsp;very well except for one &lt;BR /&gt;
problem.&amp;nbsp; When prompted for the first line of text, if&amp;nbsp;you enter a &lt;BR /&gt;
string of text the first space&amp;nbsp;you type is read as an ENTER.&amp;nbsp; &lt;BR /&gt;
Subsequent spaces are accepted as spaces.&amp;nbsp; Enclosing the first line of text &lt;BR /&gt;
in quotes as you enter it on the command line is the only way the routine will &lt;BR /&gt;
accept spaces in it.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:8772rm$ks613@adesknews2.autodesk.com"&amp;gt;news:8772rm$ks613@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;With a wave of my magic wand . . .&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA &lt;BR /&gt;
  Text Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar "CLayer"))&lt;BR /&gt;&amp;nbsp; (command &lt;BR /&gt;
  "._layer" "_m" "53" "")&lt;BR /&gt;&amp;nbsp; (initdia)&lt;BR /&gt;&amp;nbsp; (command &lt;BR /&gt;
  "._qleader")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (while (not (wcmatch (getvar "LastPrompt") &lt;BR /&gt;
  "Specify text width*"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command pause)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  )&lt;BR /&gt;&amp;nbsp; (command (getstring "\nEnter first line of annotation text &lt;BR /&gt;
  &amp;lt;Mtext&amp;gt;: "))&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; (setvar "CLayer" &lt;BR /&gt;
  clayer)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, &lt;BR /&gt;
  MCSE&lt;BR /&gt;Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." in &lt;BR /&gt;
  my address for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
    wrote in message &lt;A&gt;&lt;BR /&gt;
    href="news:876pua$i9a22@adesknews2.autodesk.com"&amp;gt;news:876pua$i9a22@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; This routine results in the&amp;nbsp;leader &lt;BR /&gt;
    line being created on the "53" layer but the text ends up on the layer &lt;BR /&gt;
    stored in "clayer".&amp;nbsp; The initdia of course doesn't have any affect on &lt;BR /&gt;
    the first part of the qleader command that draws the line, and lapses before &lt;BR /&gt;
    the actual mtext prompt comes up, resulting in the mtext being entered on &lt;BR /&gt;
    the command line.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; I tried working out this problem myself &lt;BR /&gt;
    a few weeks ago on AC2K and never could get it to work right.&amp;nbsp; Is there &lt;BR /&gt;
    a way to modify it so that the text comes in on the same layer as the leader &lt;BR /&gt;
    and still have the routine switch back to the previously current layer when &lt;BR /&gt;
    it's done?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2000 19:43:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828667#M160686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T19:43:49Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828668#M160687</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Oh, rats! Fix this line:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; (command (getstring "\nEnter first line of &lt;BR /&gt;
annotation text &amp;lt;Mtext&amp;gt;: " &lt;FONT color="#ff0000"&gt;T&lt;/FONT&gt;))&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;-- &lt;BR /&gt;
&lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network Administrator (or, Modern-day &lt;BR /&gt;
Wizard)&lt;BR /&gt;(remove the "not." in my address for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:877cth$nnq3@adesknews2.autodesk.com"&amp;gt;news:877cth$nnq3@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;This routine works&amp;nbsp;very well except for one &lt;BR /&gt;
  problem.&amp;nbsp; When prompted for the first line of text, if&amp;nbsp;you enter a &lt;BR /&gt;
  string of text the first space&amp;nbsp;you type is read as an ENTER.&amp;nbsp; &lt;BR /&gt;
  Subsequent spaces are accepted as spaces.&amp;nbsp; Enclosing the first line of &lt;BR /&gt;
  text in quotes as you enter it on the command line is the only way the routine &lt;BR /&gt;
  will accept spaces in it.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
    wrote in message &lt;A&gt;&lt;BR /&gt;
    href="news:8772rm$ks613@adesknews2.autodesk.com"&amp;gt;news:8772rm$ks613@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;With a wave of my magic wand . . .&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer)&lt;BR /&gt;&amp;nbsp; (prompt &lt;BR /&gt;
    "\nGBA Text Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar "CLayer"))&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
    (command "._layer" "_m" "53" "")&lt;BR /&gt;&amp;nbsp; (initdia)&lt;BR /&gt;&amp;nbsp; (command &lt;BR /&gt;
    "._qleader")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (while (not (wcmatch (getvar "LastPrompt") &lt;BR /&gt;
    "Specify text width*"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command &lt;BR /&gt;
    pause)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (command (getstring "\nEnter first line &lt;BR /&gt;
    of annotation text &amp;lt;Mtext&amp;gt;: "))&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;
    size=2&amp;gt;&amp;nbsp; (setvar "CLayer" clayer)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
    (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network &lt;BR /&gt;
    Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." in my address &lt;BR /&gt;
    for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
    style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
      &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
      href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
      wrote in message &lt;A&gt;&lt;BR /&gt;
      href="news:876pua$i9a22@adesknews2.autodesk.com"&amp;gt;news:876pua$i9a22@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; This routine results in &lt;BR /&gt;
      the&amp;nbsp;leader line being created on the "53" layer but the text ends up &lt;BR /&gt;
      on the layer stored in "clayer".&amp;nbsp; The initdia of course doesn't have &lt;BR /&gt;
      any affect on the first part of the qleader command that draws the line, &lt;BR /&gt;
      and lapses before the actual mtext prompt comes up, resulting in the mtext &lt;BR /&gt;
      being entered on the command line.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; I tried working out this problem &lt;BR /&gt;
      myself a few weeks ago on AC2K and never could get it to work right.&amp;nbsp; &lt;BR /&gt;
      Is there a way to modify it so that the text comes in on the same layer as &lt;BR /&gt;
      the leader and still have the routine switch back to the previously &lt;BR /&gt;
      current layer when it's done?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2000 19:56:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828668#M160687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T19:56:28Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828669#M160688</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Perfect!&amp;nbsp;&amp;nbsp; Thank you very &lt;BR /&gt;
much.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:877dq0$nmr6@adesknews2.autodesk.com"&amp;gt;news:877dq0$nmr6@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Oh, rats! Fix this line:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; (command (getstring "\nEnter first line of &lt;BR /&gt;
  annotation text &amp;lt;Mtext&amp;gt;: " &lt;FONT&gt;&lt;BR /&gt;
  color=#ff0000&amp;gt;T&lt;/FONT&gt;))&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network &lt;BR /&gt;
  Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." in my address for &lt;BR /&gt;
  direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
    wrote in message &lt;A&gt;&lt;BR /&gt;
    href="news:877cth$nnq3@adesknews2.autodesk.com"&amp;gt;news:877cth$nnq3@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;This routine works&amp;nbsp;very well except for &lt;BR /&gt;
    one problem.&amp;nbsp; When prompted for the first line of text, if&amp;nbsp;you &lt;BR /&gt;
    enter a string of text the first space&amp;nbsp;you type is read as an &lt;BR /&gt;
    ENTER.&amp;nbsp; Subsequent spaces are accepted as spaces.&amp;nbsp; Enclosing the &lt;BR /&gt;
    first line of text in quotes as you enter it on the command line is the only &lt;BR /&gt;
    way the routine will accept spaces in &lt;BR /&gt;
it.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2000 21:05:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828669#M160688</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T21:05:54Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828670#M160689</link>
      <description>This creates both parts on layer 53 for me:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "._layer" "_s" "53" "")&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
This creates the leader on 53 and the Mtext on layer 0:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "._layer" "_m" "53" "")&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
And so does this does this:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dl ( / clayer s1b)&lt;BR /&gt;
  (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
  (setq clayer (getvar "clayer"))&lt;BR /&gt;
  (command "._layer" "_m" "53" "")&lt;BR /&gt;
  (command "._qleader")&lt;BR /&gt;
  (setq s1b (entget (entlast)))&lt;BR /&gt;
  (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
  (entmod s1b)&lt;BR /&gt;
  (setvar "clayer" clayer)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
However, after completing the dl program, you can run:&lt;BR /&gt;
&lt;BR /&gt;
(defun c:dla (/ s1b)&lt;BR /&gt;
  (setq s1b (entget (entlast)))&lt;BR /&gt;
  (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
  (entmod s1b)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
And the Mtext will be on layer 53.  I even tried dla as a subroutine, but&lt;BR /&gt;
to no avail.  It seems that you must be returned to the command prompt&lt;BR /&gt;
after using Mtext before any modifications are valid.&lt;BR /&gt;
--&lt;BR /&gt;
Dave D&lt;BR /&gt;
&lt;BR /&gt;
R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;lt;877584$l0d21@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; Are you sure about the "set" Dave? I still get their error. You are&lt;BR /&gt;
correct&lt;BR /&gt;
&amp;gt; about the (initdia), I never thought about removing it.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt;&lt;/NOT.ROBERTB&gt;</description>
      <pubDate>Tue, 01 Feb 2000 21:15:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828670#M160689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828671#M160690</link>
      <description>Hmm, I wonder if it a "subtle" difference in MDT4 vs. whatever version you&lt;BR /&gt;
are using? Your "set" code, as reproduced below, still puts the MText on the&lt;BR /&gt;
CLayer's layer.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
(remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&lt;BR /&gt;
David Doane &lt;LECTRO-MECH&gt; wrote in message&lt;BR /&gt;
news:01bf6cf9$6bab2ce0$4a55d2d0@lms-1...&lt;BR /&gt;
&amp;gt; This creates both parts on layer 53 for me:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun c:dl ( / clayer)&lt;BR /&gt;
&amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt;   (command "._layer" "_s" "53" "")&lt;BR /&gt;
&amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt;   (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; This creates the leader on 53 and the Mtext on layer 0:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun c:dl ( / clayer)&lt;BR /&gt;
&amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt;   (command "._layer" "_m" "53" "")&lt;BR /&gt;
&amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt;   (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; And so does this does this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun c:dl ( / clayer s1b)&lt;BR /&gt;
&amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt;   (command "._layer" "_m" "53" "")&lt;BR /&gt;
&amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt;   (setq s1b (entget (entlast)))&lt;BR /&gt;
&amp;gt;   (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
&amp;gt;   (entmod s1b)&lt;BR /&gt;
&amp;gt;   (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; However, after completing the dl program, you can run:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun c:dla (/ s1b)&lt;BR /&gt;
&amp;gt;   (setq s1b (entget (entlast)))&lt;BR /&gt;
&amp;gt;   (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
&amp;gt;   (entmod s1b)&lt;BR /&gt;
&amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; And the Mtext will be on layer 53.  I even tried dla as a subroutine, but&lt;BR /&gt;
&amp;gt; to no avail.  It seems that you must be returned to the command prompt&lt;BR /&gt;
&amp;gt; after using Mtext before any modifications are valid.&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Dave D&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;gt; &amp;lt;877584$l0d21@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; &amp;gt; Are you sure about the "set" Dave? I still get their error. You are&lt;BR /&gt;
&amp;gt; correct&lt;BR /&gt;
&amp;gt; &amp;gt; about the (initdia), I never thought about removing it.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; &amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; &amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/NOT.ROBERTB&gt;&lt;/LECTRO-MECH&gt;</description>
      <pubDate>Tue, 01 Feb 2000 21:45:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828671#M160690</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T21:45:18Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828672#M160691</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Glad to help. Might even use it myself! &lt;BR /&gt;
&amp;lt;g&amp;gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network Administrator (or, Modern-day &lt;BR /&gt;
Wizard)&lt;BR /&gt;(remove the "not." in my address for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:877hnd$nnq12@adesknews2.autodesk.com"&amp;gt;news:877hnd$nnq12@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Perfect!&amp;nbsp;&amp;nbsp; Thank you very &lt;BR /&gt;
  much.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
    wrote in message &lt;A&gt;&lt;BR /&gt;
    href="news:877dq0$nmr6@adesknews2.autodesk.com"&amp;gt;news:877dq0$nmr6@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Oh, rats! Fix this line:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; (command (getstring "\nEnter first line &lt;BR /&gt;
    of annotation text &amp;lt;Mtext&amp;gt;: " &lt;FONT&gt;&lt;BR /&gt;
    color=#ff0000&amp;gt;T&lt;/FONT&gt;))&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, &lt;BR /&gt;
    MCSE&lt;BR /&gt;Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the "not." &lt;BR /&gt;
    in my address for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
    style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
      &lt;DIV&gt;DBlaha &amp;lt;&lt;A&gt;&lt;BR /&gt;
      href="mailto:dblaha@fisherhamilton.com"&amp;gt;dblaha@fisherhamilton.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
      wrote in message &lt;A&gt;&lt;BR /&gt;
      href="news:877cth$nnq3@adesknews2.autodesk.com"&amp;gt;news:877cth$nnq3@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;This routine works&amp;nbsp;very well except for &lt;BR /&gt;
      one problem.&amp;nbsp; When prompted for the first line of text, if&amp;nbsp;you &lt;BR /&gt;
      enter a string of text the first space&amp;nbsp;you type is read as an &lt;BR /&gt;
      ENTER.&amp;nbsp; Subsequent spaces are accepted as spaces.&amp;nbsp; Enclosing the &lt;BR /&gt;
      first line of text in quotes as you enter it on the command line is the &lt;BR /&gt;
      only way the routine will accept spaces in &lt;BR /&gt;
  it.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 01 Feb 2000 21:45:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828672#M160691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T21:45:44Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828673#M160692</link>
      <description>Must be.  I was testing in A2K, and R14 has no native qleader command. &lt;BR /&gt;
However it is one of the Express Tools for R14 in the file leaderex.arx.&lt;BR /&gt;
--&lt;BR /&gt;
Dave D&lt;BR /&gt;
&lt;BR /&gt;
R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;lt;877k5i$ndn25@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; Hmm, I wonder if it a "subtle" difference in MDT4 vs. whatever version&lt;BR /&gt;
you&lt;BR /&gt;
&amp;gt; are using? Your "set" code, as reproduced below, still puts the MText on&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; CLayer's layer.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; David Doane &lt;LECTRO-MECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:01bf6cf9$6bab2ce0$4a55d2d0@lms-1...&lt;BR /&gt;
&amp;gt; &amp;gt; This creates both parts on layer 53 for me:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (defun c:dl ( / clayer)&lt;BR /&gt;
&amp;gt; &amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt; &amp;gt;   (command "._layer" "_s" "53" "")&lt;BR /&gt;
&amp;gt; &amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt; &amp;gt;   (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt; &amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; &amp;gt; )&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; This creates the leader on 53 and the Mtext on layer 0:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (defun c:dl ( / clayer)&lt;BR /&gt;
&amp;gt; &amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt; &amp;gt;   (command "._layer" "_m" "53" "")&lt;BR /&gt;
&amp;gt; &amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt; &amp;gt;   (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt; &amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; &amp;gt; )&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; And so does this does this:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (defun c:dl ( / clayer s1b)&lt;BR /&gt;
&amp;gt; &amp;gt;   (prompt "\nGBA Text Leader\n")&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq clayer (getvar "clayer"))&lt;BR /&gt;
&amp;gt; &amp;gt;   (command "._layer" "_m" "53" "")&lt;BR /&gt;
&amp;gt; &amp;gt;   (command "._qleader")&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq s1b (entget (entlast)))&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
&amp;gt; &amp;gt;   (entmod s1b)&lt;BR /&gt;
&amp;gt; &amp;gt;   (setvar "clayer" clayer)&lt;BR /&gt;
&amp;gt; &amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; &amp;gt; )&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; However, after completing the dl program, you can run:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (defun c:dla (/ s1b)&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq s1b (entget (entlast)))&lt;BR /&gt;
&amp;gt; &amp;gt;   (setq s1b (subst (cons 8 "53") (assoc 8 s1b) s1b))&lt;BR /&gt;
&amp;gt; &amp;gt;   (entmod s1b)&lt;BR /&gt;
&amp;gt; &amp;gt;   (princ)&lt;BR /&gt;
&amp;gt; &amp;gt; )&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; And the Mtext will be on layer 53.  I even tried dla as a subroutine,&lt;BR /&gt;
but&lt;BR /&gt;
&amp;gt; &amp;gt; to no avail.  It seems that you must be returned to the command prompt&lt;BR /&gt;
&amp;gt; &amp;gt; after using Mtext before any modifications are valid.&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; Dave D&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in article&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;lt;877584$l0d21@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Are you sure about the "set" Dave? I still get their error. You are&lt;BR /&gt;
&amp;gt; &amp;gt; correct&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; about the (initdia), I never thought about removing it.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;&lt;/NOT.ROBERTB&gt;&lt;/LECTRO-MECH&gt;&lt;/NOT.ROBERTB&gt;</description>
      <pubDate>Tue, 01 Feb 2000 22:14:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828673#M160692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T22:14:18Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828674#M160693</link>
      <description>Hi there,&lt;BR /&gt;
&lt;BR /&gt;
The following is my custom qleader routine which I wrote a few weeks ago,&lt;BR /&gt;
with a bit of help from others in this newsgroup.&lt;BR /&gt;
&lt;BR /&gt;
;;; Quick leader routine&lt;BR /&gt;
;;; by Chris Needham&lt;BR /&gt;
;;; 5-1-00&lt;BR /&gt;
(if (member "leaderex.arx" (arx))&lt;BR /&gt;
    nil&lt;BR /&gt;
    (arxload "leaderex.arx")&lt;BR /&gt;
)   ;added by Mike Weaver, 6-1-00&lt;BR /&gt;
&lt;BR /&gt;
(defun c:qq ()&lt;BR /&gt;
 (setq oldorthomode (getvar "orthomode"))&lt;BR /&gt;
 (setq oldosmode (getvar "osmode"))&lt;BR /&gt;
 (setq oldtexteval (getvar "texteval"))&lt;BR /&gt;
 (setq oldcmdecho (getvar "cmdecho"))&lt;BR /&gt;
 (setq oldceltype (getvar "celtype"))&lt;BR /&gt;
 (setvar "orthomode" 0)&lt;BR /&gt;
 (setvar "osmode" 16417)&lt;BR /&gt;
 (setvar "texteval" 1)&lt;BR /&gt;
 (setvar "cmdecho" 1)&lt;BR /&gt;
 (setvar "celtype" "continuous")&lt;BR /&gt;
 (command "_.qleader"&lt;BR /&gt;
  (while (= (logand (getvar "cmdactive") 1) 1)&lt;BR /&gt;
   (command pause)&lt;BR /&gt;
  )&lt;BR /&gt;
 )&lt;BR /&gt;
 (setvar "orthomode" oldorthomode)&lt;BR /&gt;
 (setvar "texteval" oldtexteval)&lt;BR /&gt;
 (setvar "osmode" oldosmode)&lt;BR /&gt;
 (setvar "cmdecho" oldcmdecho)&lt;BR /&gt;
 (setvar "celtype" oldceltype)&lt;BR /&gt;
 (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
(defun c:tq ()&lt;BR /&gt;
 (setq oldlayer (getvar "clayer"))&lt;BR /&gt;
 (setvar "clayer" "text-3")&lt;BR /&gt;
 (command (c:qq))&lt;BR /&gt;
 (setvar "clayer" oldlayer)&lt;BR /&gt;
 (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
By altering the  (setq oldlayer (getvar "clayer")) line to suit your layers,&lt;BR /&gt;
you should have no problems. By the way, I have added a few more in my&lt;BR /&gt;
routine to automatically set different layers.&lt;BR /&gt;
&lt;BR /&gt;
Good luck,&lt;BR /&gt;
&lt;BR /&gt;
Chris Needham.&lt;BR /&gt;
New Zealand.&lt;BR /&gt;
R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
news:877584$l0d21@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Are you sure about the "set" Dave? I still get their error. You are&lt;BR /&gt;
correct&lt;BR /&gt;
&amp;gt; about the (initdia), I never thought about removing it.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;
&amp;gt; (remove the "not." in my address for direct e-mail)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/NOT.ROBERTB&gt;</description>
      <pubDate>Tue, 01 Feb 2000 23:01:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828674#M160693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-01T23:01:02Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828675#M160694</link>
      <description>&lt;DIV&gt;&lt;FONT color="#000000" size="2"&gt;Excellent question...I'm up against the same &lt;BR /&gt;
thing myself.&amp;nbsp; Seems to me that dimensions act the same way.&amp;nbsp; The &lt;BR /&gt;
Mtext is entered AFTER the layer is reset.&amp;nbsp; I'm eagerly awaiting an answer &lt;BR /&gt;
to this one.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT color="#000000" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;-mjm&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: 5px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;DBlaha&lt;DBLAHA&gt; wrote in message &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:876pua$i9a22@adesknews2.autodesk.com"&amp;gt;876pua$i9a22@adesknews2.autodesk.com&lt;/A&gt;&amp;gt;...&lt;/DBLAHA&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; This routine results in the&amp;nbsp;leader &lt;BR /&gt;
    line being created on the "53" layer but the text ends up on the &lt;BR /&gt;
    layer stored in "clayer".&amp;nbsp; The initdia of course doesn't have &lt;BR /&gt;
    any affect on the first part of the qleader command that draws the line, and &lt;BR /&gt;
    lapses before the actual mtext prompt comes up, resulting in the mtext being &lt;BR /&gt;
    entered on the command line.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; I tried working out this problem myself &lt;BR /&gt;
    a few weeks ago on AC2K and never could get it to work right.&amp;nbsp; Is there &lt;BR /&gt;
    a way to modify it so that the text comes in on the same layer as the leader &lt;BR /&gt;
    and still have the routine switch back to the previously current layer when &lt;BR /&gt;
    it's done?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
    wrote in message &lt;A&gt;&lt;BR /&gt;
    href="news:874i4v$d659@adesknews2.autodesk.com"&amp;gt;news:874i4v$d659@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
    &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
    style="BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
        &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Under AC2K (I'm assuming here, please post &lt;BR /&gt;
        that information next time) you do not need the (while) loop, due to the &lt;BR /&gt;
        use of (initdia). So here is your revised routine. The green lines &lt;BR /&gt;
        (commented) lines should just be deleted. You do not need the qleader &lt;BR /&gt;
        variable declaration (you are not using a qleader &lt;BR /&gt;
        variable!).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer &lt;FONT&gt;&lt;BR /&gt;
        color=#008000&amp;gt;qleader&lt;/FONT&gt;)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA Text &lt;BR /&gt;
        Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar &lt;BR /&gt;
        "clayer"))&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; (command &lt;BR /&gt;
        "._layer" "_m" "53" &lt;BR /&gt;
        "")&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (initdia)&lt;BR /&gt;&amp;nbsp; &lt;FONT&gt;&lt;BR /&gt;
        color=#ff0000&amp;gt;(command "._qleader")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;FONT&gt;&lt;BR /&gt;
        color=#008000&amp;gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand &lt;BR /&gt;
        (getvar "cmdactive") 1) &lt;BR /&gt;
        1)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
        (command pause)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&amp;nbsp; &lt;BR /&gt;
        (setvar "clayer" clayer)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
        (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I changed the "layer" &lt;BR /&gt;
        "s" to "layer" "m", to make the layer. if &lt;BR /&gt;
        it does not exist. Of course, it would be white in that case, but at &lt;BR /&gt;
        least the routine would not bomb!&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, &lt;BR /&gt;
        MCSE&lt;BR /&gt;Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the &lt;BR /&gt;
        "not." in my address for direct e-mail)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
        &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Robert Asher &amp;lt;&lt;A&gt;&lt;BR /&gt;
        href="mailto:rasher@gbutler.com"&amp;gt;rasher@gbutler.com&lt;/A&gt;&amp;gt; wrote in &lt;BR /&gt;
        message &lt;A&gt;&lt;BR /&gt;
        href="news:874efs$csc7@adesknews2.autodesk.com"&amp;gt;news:874efs$csc7@adesknews2.autodesk.com&lt;/A&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT&gt;&lt;BR /&gt;
        face=Arial size=2&amp;gt;&amp;gt; Could somebody take a look at this macro and tell &lt;BR /&gt;
        me what I've got wrong?&lt;BR /&gt;&amp;gt; I'm trying to make it so that when you &lt;BR /&gt;
        type "DL", the current layer will&lt;BR /&gt;&amp;gt; switch to &lt;BR /&gt;
        "53", continue the qleader command, and then at the end, &lt;BR /&gt;
        switch&lt;BR /&gt;&amp;gt; back to whatever was the previous current layer. As it &lt;BR /&gt;
        is, the lisp doesn't&lt;BR /&gt;&amp;gt; work right, and I lack the knowledge to &lt;BR /&gt;
        finish it.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; Thanks for any help,&lt;BR /&gt;&amp;gt; Robert &lt;BR /&gt;
        Asher&lt;BR /&gt;&amp;gt; George Butler Associates, Inc.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;
        (defun c:dl ( / clayer qleader)&lt;BR /&gt;&amp;gt; &amp;nbsp; (prompt "\nGBA Text &lt;BR /&gt;
        Leader\n")&lt;BR /&gt;&amp;gt; &amp;nbsp; (setq clayer (getvar &lt;BR /&gt;
        "clayer"))&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "layer" &lt;BR /&gt;
        "s" "53" "")&lt;BR /&gt;&amp;gt; &amp;nbsp; &lt;BR /&gt;
        (initdia)&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "_qleader")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
        &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar &lt;BR /&gt;
        "cmdactive") 1) 1)&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
        &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
        (command pause)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
        &amp;nbsp;&amp;nbsp; (setvar "clayer" clayer)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; &lt;BR /&gt;
        (princ)&lt;BR /&gt;&amp;gt; )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;BR /&gt;
&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 11 Feb 2000 15:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828675#M160694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-11T15:02:01Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828676#M160695</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Michael, that thread you quote below actually went &lt;BR /&gt;
a lot further, and the problem _was_ eliminated. Go back to that thread and read &lt;BR /&gt;
the rest!&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, MCSE&lt;BR /&gt;Network Administrator (or, Modern-day &lt;BR /&gt;
Wizard)&lt;BR /&gt;(remove the "not." in my address for direct e-mail)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;michael montagne &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:montagne@easystreet.com"&amp;gt;montagne@easystreet.com&lt;/A&gt;&amp;gt; wrote in &lt;BR /&gt;
  message &lt;A&gt;&lt;BR /&gt;
  href="news:8818ji$2mr11@adesknews2.autodesk.com"&amp;gt;news:8818ji$2mr11@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT color="#000000" size="2"&gt;Excellent question...I'm up against the same &lt;BR /&gt;
  thing myself.&amp;nbsp; Seems to me that dimensions act the same way.&amp;nbsp; The &lt;BR /&gt;
  Mtext is entered AFTER the layer is reset.&amp;nbsp; I'm eagerly awaiting an &lt;BR /&gt;
  answer to this one.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT color="#000000" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT size="2"&gt;-mjm&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;DBlaha&lt;DBLAHA&gt; wrote in message &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:876pua$i9a22@adesknews2.autodesk.com"&amp;gt;876pua$i9a22@adesknews2.autodesk.com&lt;/A&gt;&amp;gt;...&lt;/DBLAHA&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; This routine results in the&amp;nbsp;leader &lt;BR /&gt;
    line being created on the "53" layer but the text ends up on the layer &lt;BR /&gt;
    stored in "clayer".&amp;nbsp; The initdia of course doesn't have any affect on &lt;BR /&gt;
    the first part of the qleader command that draws the line, and lapses before &lt;BR /&gt;
    the actual mtext prompt comes up, resulting in the mtext being entered on &lt;BR /&gt;
    the command line.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; I tried working out this problem myself &lt;BR /&gt;
    a few weeks ago on AC2K and never could get it to work right.&amp;nbsp; Is there &lt;BR /&gt;
    a way to modify it so that the text comes in on the same layer as the leader &lt;BR /&gt;
    and still have the routine switch back to the previously current layer when &lt;BR /&gt;
    it's done?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Dave&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
    &lt;DIV&gt;R. Robert Bell &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:not.robertb@mwengineers.com"&amp;gt;not.robertb@mwengineers.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
    wrote in message &lt;A&gt;&lt;BR /&gt;
    href="news:874i4v$d659@adesknews2.autodesk.com"&amp;gt;news:874i4v$d659@adesknews2.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
    &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
    style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Under AC2K (I'm assuming here, please post &lt;BR /&gt;
      that information next time) you do not need the (while) loop, due to the &lt;BR /&gt;
      use of (initdia). So here is your revised routine. The green lines &lt;BR /&gt;
      (commented) lines should just be deleted. You do not need the qleader &lt;BR /&gt;
      variable declaration (you are not using a qleader variable!).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;(defun c:dl ( / clayer &lt;FONT&gt;&lt;BR /&gt;
      color=#008000&amp;gt;qleader&lt;/FONT&gt;)&lt;BR /&gt;&amp;nbsp; (prompt "\nGBA Text &lt;BR /&gt;
      Leader\n")&lt;BR /&gt;&amp;nbsp; (setq clayer (getvar "clayer"))&lt;BR /&gt;&lt;FONT&gt;&lt;BR /&gt;
      color=#ff0000&amp;gt;&amp;nbsp; (command "._layer" "_m" "53" "")&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
      (initdia)&lt;BR /&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;(command &lt;BR /&gt;
      "._qleader")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;FONT&gt;&lt;BR /&gt;
      color=#008000&amp;gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar &lt;BR /&gt;
      "cmdactive") 1) &lt;BR /&gt;
      1)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
      (command pause)&lt;BR /&gt;;;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&amp;nbsp; &lt;BR /&gt;
      (setvar "clayer" clayer)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I changed the "layer" "s" to "layer" "m", to &lt;BR /&gt;
      make the layer. if it does not exist. Of course, it would be white in that &lt;BR /&gt;
      case, but at least the routine would not bomb!&lt;BR /&gt;-- &lt;BR /&gt;R. Robert Bell, &lt;BR /&gt;
      MCSE&lt;BR /&gt;Network Administrator (or, Modern-day Wizard)&lt;BR /&gt;(remove the &lt;BR /&gt;
      "not." in my address for direct e-mail)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
      &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Robert Asher &amp;lt;&lt;A&gt;&lt;BR /&gt;
      href="mailto:rasher@gbutler.com"&amp;gt;rasher@gbutler.com&lt;/A&gt;&amp;gt; wrote in &lt;BR /&gt;
      message &lt;A&gt;&lt;BR /&gt;
      href="news:874efs$csc7@adesknews2.autodesk.com"&amp;gt;news:874efs$csc7@adesknews2.autodesk.com&lt;/A&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT&gt;&lt;BR /&gt;
      face=Arial size=2&amp;gt;&amp;gt; Could somebody take a look at this macro and tell &lt;BR /&gt;
      me what I've got wrong?&lt;BR /&gt;&amp;gt; I'm trying to make it so that when you &lt;BR /&gt;
      type "DL", the current layer will&lt;BR /&gt;&amp;gt; switch to "53", continue the &lt;BR /&gt;
      qleader command, and then at the end, switch&lt;BR /&gt;&amp;gt; back to whatever was &lt;BR /&gt;
      the previous current layer. As it is, the lisp doesn't&lt;BR /&gt;&amp;gt; work right, &lt;BR /&gt;
      and I lack the knowledge to finish it.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; Thanks for any &lt;BR /&gt;
      help,&lt;BR /&gt;&amp;gt; Robert Asher&lt;BR /&gt;&amp;gt; George Butler Associates, Inc.&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
      &lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; (defun c:dl ( / clayer qleader)&lt;BR /&gt;&amp;gt; &amp;nbsp; (prompt &lt;BR /&gt;
      "\nGBA Text Leader\n")&lt;BR /&gt;&amp;gt; &amp;nbsp; (setq clayer (getvar &lt;BR /&gt;
      "clayer"))&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "layer" "s" "53" "")&lt;BR /&gt;&amp;gt; &amp;nbsp; &lt;BR /&gt;
      (initdia)&lt;BR /&gt;&amp;gt; &amp;nbsp; (command "_qleader")&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
      &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (= (logand (getvar "cmdactive") 1) &lt;BR /&gt;
      1)&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
      &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
      (command pause)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
      &amp;nbsp;&amp;nbsp; (setvar "clayer" clayer)&lt;BR /&gt;&amp;gt; &amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;gt; &lt;BR /&gt;
      )&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; &lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 11 Feb 2000 15:18:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/qleader-command-customization-help/m-p/828676#M160695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-11T15:18:32Z</dc:date>
    </item>
  </channel>
</rss>

