<?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: construction lines in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495090#M144101</link>
    <description>&lt;P&gt;should i use the smileyvery-happy after the defun c: ?&lt;/P&gt;</description>
    <pubDate>Wed, 04 Feb 2015 17:56:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-02-04T17:56:20Z</dc:date>
    <item>
      <title>construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494927#M144091</link>
      <description>&lt;P&gt;need help, my lisp isn't working.&amp;nbsp; Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun-q c:dz(/ss1)&lt;BR /&gt;&amp;nbsp;(princ"\nErease all xlines:")&lt;BR /&gt;&amp;nbsp;(if(setq ss1(ssget"X"(list(cons 0"XLINE")(con67(if(xyz_is_paper)1 0))))))&lt;BR /&gt;&amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp; (command"erase"ss1)&lt;BR /&gt;&amp;nbsp; (princ(strcat"\Erased "(itoa(sslength ss1))"xlines"))&lt;BR /&gt;&amp;nbsp;);_progn&lt;BR /&gt;)'_if&lt;BR /&gt;&amp;nbsp;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 16:13:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494927#M144091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T16:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494961#M144092</link>
      <description>&lt;P&gt;Welcome to these Forums.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks to me as though you have an extra right parenthesis at the end of the longest line.&amp;nbsp; If removing one doesn't fix it, post your (xyz_is_paper) function [do you know&amp;nbsp;that's loaded?], in case&amp;nbsp;the problem&amp;nbsp;might be in that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, though it may not make a difference, try (defun) rather than the old (defun-q) function&amp;nbsp;[read about that].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are any Xlines on locked Layers?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, "isn't working" is not really enough information.&amp;nbsp; In what way does it not work?&amp;nbsp; Does it do something different from what you expect, or nothing at all?&amp;nbsp; Is there any error message?&amp;nbsp; Etc., etc.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 16:39:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494961#M144092</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-04T16:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494986#M144093</link>
      <description>&lt;P&gt;when I try to enter it, it says unknown command.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 16:51:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494986#M144093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494992#M144094</link>
      <description>&lt;P&gt;tried it but still get "dz Unknown command "DZ".&amp;nbsp; Press F1 for help."&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 16:57:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5494992#M144094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T16:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495039#M144095</link>
      <description>&lt;P&gt;Hi agmic,&lt;/P&gt;
&lt;P&gt;when formatting the code, you'll need to pay attention at the spaces between functions and arguments...&lt;BR /&gt;Was required an extra enter "" to finalize the erase command.&lt;/P&gt;
&lt;P&gt;Assuming you have Vladimir Nesterovsky's 'xyz_is_paper' loaded, should work as expected&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:dz ( / ss1)
 (princ"\nErease all xlines:")
 (if (setq ss1 (ssget "X" (list (cons 0"XLINE")(cons 67 (if (xyz_is_paper) 1 0)))))
  (progn
  (command "erase" ss1 "")
  (princ (strcat "\Erased " (itoa(sslength ss1)) " xlines"))
 );_progn
);_if
 (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:24:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495039#M144095</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-02-04T17:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495053#M144096</link>
      <description>&lt;P&gt;still not working. Anyone have another lisp routine to delete construction lines?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:32:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495053#M144096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T17:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495067#M144097</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;still not working.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you have Vladimir Nesterovsky's 'xyz_is_paper' loaded?&lt;/P&gt;
&lt;P&gt;If not, add this function to &lt;EM&gt;'your'&lt;/EM&gt; code, and try again...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;;;=========================================================================
;;; xyz_is_paper - returns nil for modelspace, T for paperspace
;;;  by Vladimir Nesterovsky
;;; use (cons 67 (if (xyz_is_paper) 1 0)) for ssget "X" of mspace vs. pspace
;;;  note that pspace will get all objects in layouts, not just current
;;;=========================================================================
(defun-q xyz_is_paper () (&amp;gt; 2 (getvar "cvport") (getvar "tilemode")))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:37:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495067#M144097</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-02-04T17:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495070#M144098</link>
      <description>&lt;P&gt;sorry, how do you add this function?&amp;nbsp; or can i just change the paper to model?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:40:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495070#M144098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T17:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495080#M144099</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;sorry, how do you add this function?&amp;nbsp; or can i just change the paper to model?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;;;=========================================================================
;;; xyz_is_paper - returns nil for modelspace, T for paperspace
;;;  by Vladimir Nesterovsky
;;; use (cons 67 (if (xyz_is_paper) 1 0)) for ssget "X" of mspace vs. pspace
;;;  note that pspace will get all objects in layouts, not just current
;;;=========================================================================
(defun-q xyz_is_paper () (&amp;gt; 2 (getvar "cvport") (getvar "tilemode")))

(defun c:dz ( / ss1)
 (princ"\nErease all xlines:")
 (if (setq ss1 (ssget "X" (list (cons 0"XLINE")(cons 67 (if (xyz_is_paper) 1 0)))))
  (progn
  (command "erase" ss1 "")
  (princ (strcat "\Erased " (itoa(sslength ss1)) " xlines"))
 );_progn
);_if
 (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:49:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495080#M144099</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-02-04T17:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495081#M144100</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;still not working. Anyone have another lisp routine to delete construction lines?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Again, what does "not working" mean? &amp;nbsp;Still an unknown command? &amp;nbsp;If not, I would guess that it's in the (xyz_is_paper) function, or that function is not loaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to delete all Xlines in the &lt;FONT color="#FF0000"&gt;current space&lt;/FONT&gt;, try something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:DZ (/ ss1)&lt;BR /&gt;&amp;nbsp; (prompt "\nErase all Xlines:")&lt;BR /&gt;&amp;nbsp; (if (setq ss1 (ssget "_X" (list '(0 . "XLINE") &lt;FONT color="#FF0000"&gt;(cons 410 (getvar 'ctab))&lt;/FONT&gt;)))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (command "erase" ss1 "")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (princ (strcat "\Erased " (itoa (sslength ss1)) " Xlines"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; );_progn&lt;BR /&gt;&amp;nbsp; );_if&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;); defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get rid of &lt;EM&gt;all&lt;/EM&gt; Xlines, &lt;EM&gt;regardless&lt;/EM&gt; of where they are, try something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:DZ (/ ss1 n)&lt;BR /&gt;&amp;nbsp; (prompt "\nErase all Xlines:")&lt;BR /&gt;&amp;nbsp; (if (setq ss1&amp;nbsp;&lt;SPAN&gt;(ssget "_X" '((0 . "XLINE"))))&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (repeat (setq n (sslength ss1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (entdel (ssname ss1 (setq n (1- n))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; );&amp;nbsp;repeat&lt;BR /&gt;&amp;nbsp; ); if&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;); defun&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 18:08:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495081#M144100</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-04T18:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495090#M144101</link>
      <description>&lt;P&gt;should i use the smileyvery-happy after the defun c: ?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:56:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495090#M144101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T17:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495091#M144102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;Do you have Vladimir Nesterovsky's 'xyz_is_paper' loaded?&lt;/BLOCKQUOTE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;....
;;; use (cons 67 (if (xyz_is_paper) 1 0)) for ssget "X" of mspace vs. pspace
;;;  note that pspace will &lt;FONT color="#0000FF"&gt;get all objects in layouts, not just current&lt;/FONT&gt;
;;;=========================================================================
(defun-q xyz_is_paper () (&amp;gt; 2 (getvar "cvport") (getvar "tilemode")))&lt;/PRE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that while that function, when used in paper space, may &lt;FONT color="#0000FF"&gt;get&amp;nbsp;all&lt;/FONT&gt; appropriate &lt;FONT color="#0000FF"&gt;objects in&lt;/FONT&gt; all &lt;FONT color="#0000FF"&gt;layouts&lt;/FONT&gt;, &lt;FONT color="#0000FF"&gt;not just&lt;/FONT&gt; the &lt;FONT color="#0000FF"&gt;current&lt;/FONT&gt; one, that only covers the &lt;EM&gt;finding&lt;/EM&gt; of them -- the Erase command will &lt;EM&gt;not&lt;/EM&gt; Erase those that are not in the current layout. &amp;nbsp;You would need to get into every layout and run the command in each. &amp;nbsp;If you want to get those in other than the current layout/space, without getting into each one, use something like my version that uses&amp;nbsp;(entdel).&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495091#M144102</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-04T17:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495092#M144103</link>
      <description>&lt;P&gt;Again, what does "not working" mean? &amp;nbsp;Still an unknown command? &amp;nbsp;If not, I would guess that it's in the (xyz_is_paper) function, or that function is not loaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, the "not working" means that when I load the lisp file and try to use it, autocad gives me dx unknown command"dz"...&lt;/P&gt;&lt;P&gt;Is that better...&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 17:58:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495092#M144103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T17:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495099#M144104</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;should i use the smileyvery-happy after the defun c: ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, you should go into your Profile and disable emoticons. &amp;nbsp;This is a problem that's been pointed out repeatedly around here, since a colon followed by certain letters triggers emoticons, but it's a common element in AutoLISP defined commands that get posted here. &amp;nbsp;Pick on your user name up top, in the Quick Links area at bottom right choose My Settings, in the Preferences Tab pick on Display, and under Emoticon Type pick None. &amp;nbsp;Save the change, and thereafter, whenever you are &lt;EM&gt;signed in&lt;/EM&gt;, emoticons of the colon-and-letter variety will not show.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 18:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495099#M144104</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-04T18:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495119#M144105</link>
      <description>&lt;P&gt;Working in model space, enter the command "dz" autocad says DZ unknown command "dz".&amp;nbsp; I have tried both of the routines, but neither is working.&amp;nbsp; (Unkown Command)???&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 18:15:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495119#M144105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T18:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495171#M144106</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Working in model space, enter the command "dz" autocad says DZ unknown command "dz".&amp;nbsp; I have tried both of the routines, but neither is working.&amp;nbsp; (Unkown Command)???&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are the commands loading successfully? &amp;nbsp;To recap how it should be done, just in case: &amp;nbsp;Copy the code for one of them and paste it into a plain-text editor like Notepad, and save it into a file called anything you like with a &lt;STRONG&gt;.lsp&lt;/STRONG&gt; filetype extension. &amp;nbsp;In AutoCAD, type AP [or APPLOAD] and navigate to where you saved that file, select it and pick Load, and Close. &amp;nbsp;It should put a line like this at the Command: prompt line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#33CCCC"&gt;&lt;EM&gt;WhateverYouCalledIt&lt;/EM&gt;&lt;/FONT&gt;.lsp successfully loaded.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 18:53:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495171#M144106</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-04T18:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495175#M144107</link>
      <description>&lt;P&gt;Not too different from those already posted, but try the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE style="max-height: 500px; white-space: pre; border: 1px solid #417394; overflow: auto; background: #f2f6f8; color: #222; padding: 3px; line-height: 120%;"&gt;(defun c:delx ( / i s )
    (if (setq s (ssget "_X" (list '(0 . "XLINE") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model")))))
        (repeat (setq i (sslength s)) (entdel (ssname s (setq i (1- i)))))
    )
    (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The command is 'delx'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lee&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 18:57:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495175#M144107</guid>
      <dc:creator>Lee_Mac</dc:creator>
      <dc:date>2015-02-04T18:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495183#M144108</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;Do you have Vladimir Nesterovsky's 'xyz_is_paper' loaded?&lt;/BLOCKQUOTE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;....
;;; use (cons 67 (if (xyz_is_paper) 1 0)) for ssget "X" of mspace vs. pspace
;;;  note that pspace will &lt;FONT color="#0000ff"&gt;get all objects in layouts, not just current&lt;/FONT&gt;
;;;=========================================================================
(defun-q xyz_is_paper () (&amp;gt; 2 (getvar "cvport") (getvar "tilemode")))&lt;/PRE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that while that function, when used in paper space, may &lt;FONT color="#0000ff"&gt;get&amp;nbsp;all&lt;/FONT&gt; appropriate &lt;FONT color="#0000ff"&gt;objects in&lt;/FONT&gt; all &lt;FONT color="#0000ff"&gt;layouts&lt;/FONT&gt;, &lt;FONT color="#0000ff"&gt;not just&lt;/FONT&gt; the &lt;FONT color="#0000ff"&gt;current&lt;/FONT&gt; one, that only covers the &lt;EM&gt;finding&lt;/EM&gt; of them -- the Erase command will &lt;EM&gt;not&lt;/EM&gt; Erase those that are not in the current layout. &amp;nbsp;You would need to get into every layout and run the command in each. &amp;nbsp;If you want to get those in other than the current layout/space, without getting into each one, use something like my version that uses&amp;nbsp;(entdel).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;I fully agree&lt;/SPAN&gt; with your comments.&lt;/P&gt;
&lt;P&gt;I just add Vladimir Nesterovsky's 'xyz_is_paper'&amp;nbsp;with the '&lt;SPAN class="hps"&gt;author'&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;comments and explanation, the remaining code was from the 'OP' not mine.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;I probably would have written the code using 'entdel', or simply using a 'vla' approach and 'vla-delete'...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:00:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495183#M144108</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-02-04T19:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495225#M144109</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;If you want to get rid of &lt;EM&gt;all&lt;/EM&gt; Xlines, &lt;EM&gt;regardless&lt;/EM&gt; of where they are, try something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:DZ (/ ss1 n)&lt;BR /&gt;&amp;nbsp; (prompt "\nErase all Xlines:")&lt;BR /&gt;&amp;nbsp; (if (setq ss1&amp;nbsp;&lt;SPAN&gt;(ssget "_X" '((0 . "XLINE"))))&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (repeat (setq n (sslength ss1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (entdel (ssname ss1 (setq n (1- n))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; );&amp;nbsp;repeat&lt;BR /&gt;&amp;nbsp; ); if&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;); defun&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So now that I've tried that out a little, I find it has a quirk I can't figure out. &amp;nbsp;In a drawing with two Paper-Space Layouts, if I draw some Xlines in both of them &lt;EM&gt;and&lt;/EM&gt; some in Model Space, it gets rid of the ones in Model Space and in &lt;EM&gt;one&lt;/EM&gt; of the Layouts, but not in &lt;EM&gt;both&lt;/EM&gt; Layouts. &amp;nbsp;That seems to be the case whether I run it from Model or Paper Space, and whether, when in a Layout,&amp;nbsp;I'm out in Paper Space or into Model Space through a Viewport. &amp;nbsp;If in Paper Space, it always dumps those in the &lt;EM&gt;current&lt;/EM&gt; Layout but not the other, but always gets those in Model Space, no matter where I run it from. &amp;nbsp;It apparently finds the right total &lt;EM&gt;number&lt;/EM&gt; of Xlines, but why it doesn't take them out from one of the Layouts, I couldn't say -- I'd be interested in any theories.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:34:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495225#M144109</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-04T19:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: construction lines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495273#M144110</link>
      <description>Using entdel, with ssget "_X", if we are in a layout tab, in a dwg with multi layouts, entdel will only delete objects in current layout and model space, if we are in model space, will delete model and first layout objects...&lt;BR /&gt;Or we activate each layout and erase ss, or change each entity to a vlaObject and vla-delete, will delete in all layouts...&lt;BR /&gt;&lt;BR /&gt;Henrique</description>
      <pubDate>Wed, 04 Feb 2015 20:06:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/construction-lines/m-p/5495273#M144110</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-02-04T20:06:19Z</dc:date>
    </item>
  </channel>
</rss>

