<?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 Set layer at end of lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12949913#M10464</link>
    <description>&lt;P&gt;I have this lisp file that when I specify a maximum distance and select two points, it will print points divided on a layer called "Rivet Hole". One thing I was trying to do was get the program when it finishes to set the layer to a different layer called "Text", but I am having some trouble figuring out how to do that.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2024 18:01:57 GMT</pubDate>
    <dc:creator>bemmer7MZ3G</dc:creator>
    <dc:date>2024-08-09T18:01:57Z</dc:date>
    <item>
      <title>Set layer at end of lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12949913#M10464</link>
      <description>&lt;P&gt;I have this lisp file that when I specify a maximum distance and select two points, it will print points divided on a layer called "Rivet Hole". One thing I was trying to do was get the program when it finishes to set the layer to a different layer called "Text", but I am having some trouble figuring out how to do that.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 18:01:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12949913#M10464</guid>
      <dc:creator>bemmer7MZ3G</dc:creator>
      <dc:date>2024-08-09T18:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set layer at end of lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12949936#M10465</link>
      <description>&lt;P&gt;You could 'save' the existing current layer.. e.g.&lt;/P&gt;&lt;P&gt;(setq olay (getvar 'clayer))&lt;/P&gt;&lt;P&gt;Then reset it on exit .. e.g.&lt;/P&gt;&lt;P&gt;(setvar 'clayer olay)&lt;/P&gt;&lt;P&gt;For your request to set to Layer "Text" on exit, try following.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun C:DDP (/ cc1 cc2 range spcs spc)
  ; = DIVide Distance [not object] using Points, at user-specified Maximum spacing
(command "-layer" "s" "Rivet Hole" "")
  (initget (if *DIVDPmax* 6 7)); no zero, no negative, no Enter on first use
  (setq
    *DIVDPmax* ; global variable with routine-specific name
    (cond
      ( (getdist ; returns nil on Enter when permitted
          (strcat
            "\nMaximum Point spacing"
            (if *DIVDPmax* (strcat " &amp;lt;" (rtos *DIVDPmax*) "&amp;gt;") "")
            ": "
          ); strcat
        ); getdist
      ); User-input condition
      (*DIVDPmax*); prior value if present, on Enter
    ); cond &amp;amp; *DIVDPmax*
    p1 (getpoint "\nOne end of range: ")
    p2 (getpoint "\nOther end: ")
    range (distance p1 p2)
    spcs (+ (fix (/ range *DIVDPmax*)) (if (equal (rem range *DIVDPmax*) 0 1e-4) 0 1))
    spc (/ range spcs)
  ); setq
  (setvar 'lastpoint p1); kind of interesting that that's allowed...
  (repeat (1- spcs)
    (command "_.point" "_none" (polar (getvar 'lastpoint) (angle p1 p2) spc))
  ); repeat
;; Add the next 2 lines
 (command "_.layer" "_M" "TEXT" ""); Case no Layer Text exists (nil if exists)
 (command "_.layer" "_S" "TEXT" ""); Set to Layer Text
); defun&lt;/LI-CODE&gt;&lt;P&gt;ECCAD&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 18:19:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12949936#M10465</guid>
      <dc:creator>ec-cad</dc:creator>
      <dc:date>2024-08-09T18:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set layer at end of lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12950145#M10466</link>
      <description>&lt;P&gt;[Line 30 is extraneous.&amp;nbsp; The Make option makes the Layer current in the process, so there no need for the Set option after Making it.]&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:18:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12950145#M10466</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-08-09T20:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set layer at end of lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12950159#M10467</link>
      <description>&lt;P&gt;Well, I know that, but it may be more 'clear' what's happening with (2) calls.&lt;/P&gt;&lt;P&gt;Geez&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:28:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-layer-at-end-of-lisp/m-p/12950159#M10467</guid>
      <dc:creator>ec-cad</dc:creator>
      <dc:date>2024-08-09T20:28:31Z</dc:date>
    </item>
  </channel>
</rss>

