<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>CAD Forum discussion (EN) : SS Get and Lisp Question</title>
  <link>https://www.cadforum.cz/forum_en/</link>
  <description><![CDATA[This is an XML content feed of; CAD Forum discussion (EN) : AutoCAD : SS Get and Lisp Question]]></description>
  <pubDate>Sat, 05 Sep 2026 05:34:35 +0000</pubDate>
  <lastBuildDate>Fri, 17 Oct 2014 16:18:01 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.cadforum.cz/forum_en/RSS_post_feed.asp?TID=10738</WebWizForums:feedURL>
  <image>
   <title><![CDATA[CAD Forum discussion (EN)]]></title>
   <url>https://www.cadforum.cz/forum_en/forum_images/web_wiz_forums.png</url>
   <link>https://www.cadforum.cz/forum_en/</link>
  </image>
  <item>
   <title><![CDATA[SS Get and Lisp Question : Hell everyone.I currently have...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=10738&amp;PID=28304&amp;title=ss-get-and-lisp-question#28304</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=486490">mfkozlow</a><br /><strong>Subject:</strong> 10738<br /><strong>Posted:</strong> 17.Oct.2014 at 16:18<br /><br /><font size="2">Hell everyone.<br><br>I currently have the following lisp file:</font><br><table width="99%"><tr><td><pre class="BBcode">(defun C:get_att()<br><br>&nbsp; (if (setq ss (ssget "_F" '((7 2.5) (13.5 2.5)) '((0 . "INSERT"))))<br>(progn&nbsp; <br>(setq en (ssname ss 0))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>&nbsp; (setq enlist(entget en))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- Get the DXF group codes<br><br>&nbsp; (setq blkType(cdr(assoc 0 enlist)))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- Save the type of entity<br><br>&nbsp; (if (= blkType "INSERT")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- If the entity type is an Insert entity<br><br>&nbsp;&nbsp; (progn<br><br>&nbsp;&nbsp;&nbsp; (if(= (cdr(assoc 66 enlist)) 1)&nbsp;&nbsp;&nbsp; ;- See if the attribute flag equals one (if so, attributes follow)<br><br>&nbsp;&nbsp;&nbsp; (progn<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq en2(entnext en))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- Get the next sub-entity<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq enlist2(entget en2))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- Get the DXF group codes<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq enlist3(cdr(assoc 1 enlist2)))<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (while (/= (cdr(assoc 0 enlist2)) "SEQEND")&nbsp; ;- Start the while loop and keep&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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p; ;- Print the attribute DXF group codes<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq en2(entnext en2))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- Get the next sub-entity<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq enlist2(entget en2))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;- Get the DXF group codes<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br><br>&nbsp;&nbsp;&nbsp;&nbsp; )<br><br>&nbsp;&nbsp;&nbsp; )&nbsp; ;- Close the if group code 66 = 1 statement<br><br>&nbsp;&nbsp; )<br><br>&nbsp; )&nbsp;&nbsp; ;- Close the if block type = "ATTRIB" statement<br><br>)<br><br>)&nbsp;&nbsp; ;- Close the if an Entity is selected statement<br><br>)</pre></td></tr></table> <font size="2">The lisp above gathers many useful pieces of information from the block that it intersects. I use this information later on in variables.</font><br><br><font size="2">At the beginning of the lisp the ss get function is utilized. Instead of the way it is working right now, I would like to use the following code for the ss get function.</font><br><table width="99%"><tr><td><pre class="BBcode">(defun c:thaw ( / a ex)<br>(setq ex nil)<br>(while (setq a (tblnext "LAYER" (null a)))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; (if (and (or (&gt; (cdr (assoc 70 a)) 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (minusp (cdr (assoc 62 a)))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (not (wcmatch (cdr (assoc 2 a)) "*|*"))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (setq ex (cons (strcat "," (cdr (assoc 2 a)) ) ex))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )&nbsp; <br>;;;&nbsp;&nbsp;&nbsp; For selection and processing&nbsp;&nbsp;&nbsp; ;;;<br>&nbsp;&nbsp;&nbsp; ;;;(setq ss&nbsp; (ssget "_X"<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;(append<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (list (cons 410 (getvar 'ctab)))<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;(if ex<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (list<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; '(-4 . "&lt;NOT")<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (cons 8 (strcat (apply 'strcat ex)))<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; '(-4 . "NOT&gt;")<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; '(8 . "*")<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;)<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;)<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp;&nbsp;&nbsp; &nbsp; )<br>&nbsp;&nbsp;&nbsp; ;;;&nbsp; <br>(textscr)&nbsp; <br>;;;&nbsp;&nbsp;&nbsp; Demo purposes&nbsp;&nbsp;&nbsp; ;;;<br>&nbsp; (princ "\nExcluded Layers from selection:")<br>&nbsp; (foreach itm (reverse ex)<br>&nbsp;&nbsp;&nbsp; (princ (strcat "\n" (substr itm 2))))<br>;;;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;;;<br>&nbsp; (princ)<br>&nbsp; )</pre></td></tr></table> <font size="2">The lisp above scans for all the layers that are off and returns the names of these layers in a list format.</font><br><br><font size="2">So in conclusion, I would like the ss get function to scan for all the layers that are turned off and exclude those layers from my selection. Using that list I would like to use this exact function</font><br><table width="99%"><tr><td><pre class="BBcode">(if (setq ss (ssget "_X" '((2 . "SYSTEM_SP_Q"))))</pre></td></tr></table><br><font size="2">instead of using this</font><br><table width="99%"><tr><td><pre class="BBcode">(if (setq ss (ssget "_F" '((7 2.5) (13.5 2.5)) '((0 . "INSERT"))))</pre></td></tr></table><br><br><font size="2">So to clear things up. First the lisp file will scan for the layers that are turned off. Once it knows this list I want it to exclude all the layers in that list (the ones that are off) and use it along with this function:</font><br><table width="99%"><tr><td><pre class="BBcode">(if (setq ss (ssget "_X" '((2 . "SYSTEM_SP_Q"))))</pre></td></tr></table><br><font size="2"><br>Thank you in advance for anyone who takes the time to read all of this.</font><br>]]>
   </description>
   <pubDate>Fri, 17 Oct 2014 16:18:01 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=10738&amp;PID=28304&amp;title=ss-get-and-lisp-question#28304</guid>
  </item> 
 </channel>
</rss>