<?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: Separate Hatches on multiple Layers depending on Color or Name in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9538845#M76694</link>
    <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please is it possible to ask something a little bit different but very near !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have joined the version 1.1 of your beautiful routine which separates hatches (without recreating Boudaries) on many layers depending on either Color or either Hatch Name ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because I imagine that the new routine will be very similar !?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like the same routine to process only for COLOR (So NO question !) but on ANY Entity :&lt;/P&gt;
&lt;P&gt;line, arc, 2D pline heavy or light, 3D pline, circle, ellipse, region, spline, mpolygon, text, mtext, mline, dim, hatch, 3DSolid, 3DSurface, 3DFace, 3DPolyMesh, etc ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance, THE HEALTH (Stay Safe), Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 May 2020 20:14:03 GMT</pubDate>
    <dc:creator>braudpat</dc:creator>
    <dc:date>2020-05-25T20:14:03Z</dc:date>
    <item>
      <title>Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402333#M76681</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not found the magic routine !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please I need a Lisp routine to separate Hatch depending on Colors or on Names&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I see the routine like :&lt;/P&gt;
&lt;P&gt;- Classic ACAD selection&lt;/P&gt;
&lt;P&gt;- Keep into the selection ONLY Hatch Object&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Question: Separate by Color (Default) or by Name ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Process the 1st Hatch and create (Make Layer) based on the layer hatch "XXXXXX"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;==== If Color Separation ====&lt;/P&gt;
&lt;P&gt;If standard Color (0-256), Layer Name&amp;nbsp; : XXXXXX___NNN&amp;nbsp; (where NNN is 0-256)&lt;/P&gt;
&lt;P&gt;( I would like 3 numbers if possible !? )&lt;/P&gt;
&lt;P&gt;If RGB Color , Layer Name : XXXXXX___RRR_GGG_BBB&lt;/P&gt;
&lt;P&gt;( I would like 3 x 3 numbers if possible !? )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;==== If Name Separation ====&lt;/P&gt;
&lt;P&gt;Layer name : XXXXXX___ANSI31 , XXXXXX___SOLID , etc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Process the next Hatch ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you see what I mean ? ... Thanks in advance ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sample DWG would help you ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THE HEALTH, Regards, Patrice (The Old French EE Froggy)&lt;/P&gt;
&lt;P&gt;I am hidden into my bunker ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:49:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402333#M76681</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-03-26T16:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402541#M76682</link>
      <description>&lt;P&gt;Any Color Book colors?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 18:10:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402541#M76682</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-26T18:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402761#M76683</link>
      <description>&lt;P&gt;1. Does the new layer need a color?&lt;/P&gt;&lt;P&gt;2. Is the hatch to be put on the new layer?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 19:28:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402761#M76683</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-26T19:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402779#M76684</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) YES ALL the Hatch has to be moved to the New Layer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) What do you mean by color book : Pantone, RAL, etc ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If YES and if it is not a big effort to manage these special colors :&lt;/P&gt;
&lt;P&gt;Create and Use a layer named :&amp;nbsp; XXXXXX___ColorBookName&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) The NEW layer must have the default Color &amp;amp; LineType &amp;amp; LineWeight of the original hatch layer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) The moved Hatch have to keep their original color : ByLayer, ByBlock, 0-256, RGB, etc ...&lt;/P&gt;
&lt;P&gt;and original LineType and original LineWeight ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So their new display will be the same before !?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 19:42:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402779#M76684</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-03-26T19:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402912#M76685</link>
      <description>&lt;P&gt;I'm sure this will need tweaking, but try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun LM:True-&amp;gt;RGB ( c ) (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(8 16 24)))

(defun rh:lst2str ( lst del / str) (setq str "")  (mapcar '(lambda (x) (setq str (strcat str x del))) lst) (vl-string-right-trim del str))

(defun rh:layer_props ( lyr lst / v ) (setq v (mapcar '(lambda (x) (vlax-get-property lyr x)) lst)))

(defun c:hatchlayers ( / c_doc c_lyrs l_props ans ss cnt ent elst lyr l_vals hn cstr clst clr nlyr lobj)

  (setq c_doc (vla-get-activedocument (vlax-get-acad-object))
        c_lyrs (vla-get-layers c_doc)
        l_props (list 'truecolor 'linetype 'lineweight)
  );end_setq

  (initget "Color Name")
  (setq ans (cond ( (getkword "\nSeparate Hatches by : [Color/Name] &amp;lt;Color&amp;gt; ")) ("Color")))
  
  (setq ss (ssget "_X" '((0 . "HATCH"))))
  (cond (ss
          (repeat (setq cnt (sslength ss))
            (setq ent (ssname ss (setq cnt (1- cnt)))
                  elst (entget ent)
                  lyr (cdr (assoc 8 elst))
                  l_vals (rh:layer_props (vla-item c_lyrs lyr) l_props)
                  hn  (cdr (assoc 2 elst))
                  cstr ""
            );end_setq
            (cond ( (= ans "Color")
                    (foreach x '(62 420 430) (setq clst (cons (cdr (assoc x elst)) clst)))
                    (setq clr (vl-some '(lambda (x) x) clst))
                    (cond ( (and (= (type clr) 'INT) (&amp;lt;= clr 256)) (setq cstr (itoa clr))(while (&amp;lt; (strlen cstr) 3) (setq cstr (strcat "0" cstr))))
                          ( (= (type clr) 'STR) (setq cstr clr))
                          (t (setq clr (mapcar 'itoa (LM:True-&amp;gt;RGB clr))
                                   clr (mapcar '(lambda (x) (if (&amp;lt; (strlen x) 3) (while (&amp;lt; (strlen x) 3) (setq x (strcat "0" x))) x)) clr)
                                   cstr (rh:lst2str clr "_")
                             );end_setq
                          )
                    );end_cond
                    (setq nlyr (strcat lyr "__" cstr))
                  )
                  (t (setq nlyr (strcat lyr "__" hn)))
            );end_cond
            (cond ( (not (tblsearch "layer" nlyr)) (setq lobj (vla-add c_lyrs nlyr)) (mapcar '(lambda (x y) (vlax-put-property lobj x y)) l_props l_vals)))
            (vlax-put-property (vlax-ename-&amp;gt;vla-object ent) 'layer nlyr)
          );end_repeat
        )
        (t (alert "NO Hatches Found"))
  );end_cond
  (princ)
);end_defun
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 20:42:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9402912#M76685</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-26T20:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9403019#M76686</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WAOUH I have to do some other intensive tests with a much more complex DWG !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the actual routine seems OK ! ... I removed the "_X" to get standard selection ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question: if the HATCH Color is ByLayer or ByBlock, I get always 000 !&lt;/P&gt;
&lt;P&gt;Is it normal ?? ByBlock is not 256 !?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, I appreciate your effort ! ... Tomorrow, I will do other tests ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beautiful use of mapcar , lambda , etc ... Far beyond my poor Lisp knowledge !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THE HEALTH, Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 21:37:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9403019#M76686</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-03-26T21:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9403077#M76687</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/291579"&gt;@braudpat&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;Question: if the HATCH Color is ByLayer or ByBlock, I get always 000 !&lt;/P&gt;&lt;P&gt;Is it normal ?? ByBlock is not 256 !?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It should give byblock "000" and bylayer "256". I tested byblock, but not bylayer. I will check tomorrow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;Beautiful use of mapcar , lambda , etc ... Far beyond my poor Lisp knowledge !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm still learning what is possible, but thanks. &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 22:04:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9403077#M76687</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-26T22:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9403830#M76688</link>
      <description>&lt;P&gt;Attempt 2. The problem with bylayer was I forgot to allow for the default (no 62 code).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question, what do you want to do with the hatch boundary (if present)? It's accessable if there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun LM:True-&amp;gt;RGB ( c ) (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(8 16 24)))

(defun rh:lst2str ( lst del / str ) (setq str "")  (mapcar '(lambda (x) (setq str (strcat str x del))) lst) (vl-string-right-trim del str))

(defun rh:layer_props ( lyr lst / v ) (setq v (mapcar '(lambda (x) (vlax-get-property lyr x)) lst)))

(defun rh:strlen3 ( str ) (if (&amp;lt; (strlen str) 3) (while (&amp;lt; (strlen str) 3) (setq str (strcat "0" str))) str) str)

(defun c:hatchlayers ( / c_doc c_lyrs l_props ans ss cnt ent elst lyr l_vals hn cstr clst clr nlyr lobj)

  (setq c_doc (vla-get-activedocument (vlax-get-acad-object))
        c_lyrs (vla-get-layers c_doc)
        l_props (list 'truecolor 'linetype 'lineweight);Layer properties list
  );end_setq

  (initget "Color Name")
  (setq ans (cond ( (getkword "\nSeparate Hatches by : [Color/Name] &amp;lt;Color&amp;gt; ")) ("Color")))

  (prompt "\nSelect Hatches : ")
  (setq ss (ssget '((0 . "HATCH"))))

  (cond (ss
          (repeat (setq cnt (sslength ss))
            (setq ent (ssname ss (setq cnt (1- cnt)))
                  elst (entget ent)
                  lyr (cdr (assoc 8 elst));Layer
                  l_vals (rh:layer_props (vla-item c_lyrs lyr) l_props);Layer properties
                  hn  (cdr (assoc 2 elst));Hatch pattern name
                  cstr ""
                  clst nil
            );end_setq

            (cond ( (= ans "Color")
                    (foreach x '(62 420 430) (setq clst (cons (cdr (assoc x elst)) clst)))
                    (setq clr (vl-some '(lambda (x) x) clst))
                    (cond ( (not clr) (setq cstr "256"))                ;No Color set (bylayer)
                          ( (and (= (type clr) 'INT) (&amp;lt;= clr 256))      ;ACI (0-256)
                            (setq cstr (rh:strlen3 (itoa clr)))
                          )
                          ( (= (type clr) 'STR) (setq cstr clr))        ;Color Book
                          (t (setq clr (mapcar 'itoa (LM:True-&amp;gt;RGB clr));RGB
                                   cstr (rh:lst2str (mapcar 'rh:strlen3 clr) "_")
                             );end_setq
                          )
                    );end_cond
                    (setq nlyr (strcat lyr "__" cstr))
                  )
                  (t (setq nlyr (strcat lyr "__" hn)))
            );end_cond

            (cond ( (not (tblsearch "layer" nlyr)) (setq lobj (vla-add c_lyrs nlyr)) (mapcar '(lambda (x y) (vlax-put-property lobj x y)) l_props l_vals)))
            (vlax-put-property (vlax-ename-&amp;gt;vla-object ent) 'layer nlyr)
          );end_repeat
        )
        (t (alert "NO Hatches Found"))
  );end_cond

  (princ)
);end_defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 09:30:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9403830#M76688</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-27T09:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404453#M76689</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) BRAVO ! BRAVISSIMO !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) ByBlock = 000 and ByLayer = 256 !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Even Color Books are OK !!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) I have joined my latest DWG Test (more cases) ... For Tests ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5) What do you mean with Hatch Boundaries ?&lt;/P&gt;
&lt;P&gt;If they are present !?&lt;/P&gt;
&lt;P&gt;I imagine maybe with 2 new questions !?&lt;/P&gt;
&lt;P&gt;5 - Q1) Process Boundaries (Yes/No) - Default = No&lt;/P&gt;
&lt;P&gt;5 - Q2) Copy or Move Boundaries (Yes/No) - Default = Copy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you think it's possible without big effort !?&lt;/P&gt;
&lt;P&gt;Maybe KEEP your effort for others demands because it's not my primary demand !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THANKS AGAIN, THE HEALTH, Regards, Patrice (The Old French EE Froggy)&lt;/P&gt;
&lt;P&gt;Hidden into its bunker&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:46:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404453#M76689</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-03-27T13:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404505#M76690</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;5) What do you mean with Hatch Boundaries ?&lt;/P&gt;&lt;P&gt;If they are present !?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can have a hatch without a boundary, if it has been deleted. Finding out if the boundary is there is simple. I was thinking along the lines of changing the boundary to the same layer as the hatch, or copy and change if it is not on the same layer as the hatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;5 - Q1) Process Boundaries (Yes/No) - Default = No&lt;/P&gt;&lt;P&gt;5 - Q2) Copy or Move Boundaries (Yes/No) - Default = Copy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think it's possible without big effort !?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;5.1&amp;nbsp; Define "Process" Boundaries. Would this be change their layer?&lt;/P&gt;&lt;P&gt;5.2 I don't fully understand this. Please explain in greater detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 14:07:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404505#M76690</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-27T14:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404690#M76691</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5.1 Process Boundaries (Yes/No) - Default = No&lt;/P&gt;
&lt;P&gt;Would this be change their layer ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5.2 Copy or Move Boundaries (Yes/No) - Default = Copy&lt;/P&gt;
&lt;P&gt;I don't fully understand this ... Please explain in greater detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---- OOPS SORRY my words were mysterious ! In fact that I imagine is :&lt;/P&gt;
&lt;P&gt;- If the Boundary exists, COPY it to the new layer ...&lt;/P&gt;
&lt;P&gt;- If the Boundary doesn't exist, RECREATE it to the new layer ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please remind that the aspect (of the boundary) must be the same : Color, LineType, LineWeight, Transparency, ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you think it is not too complex to add this feature to YOUR BEAUTIFUL Routine !?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beware of that into my DWG test , there are ONLY Hatches (No Boundary) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your attention, THE HEALTH, Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 15:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404690#M76691</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-03-27T15:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404721#M76692</link>
      <description>&lt;P&gt;OK. I'll see what I can do. Doesn't look too difficult. (touch wood and putting hand to head). &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 15:25:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9404721#M76692</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-27T15:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9405159#M76693</link>
      <description>&lt;P&gt;Latest Code. This recreates the boundary on the hatches new layer (where there is no associated boundary), and copies the exiting boundary then moves the original boundary to the hatch layer. Please check that this works a required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stay safe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun LM:True-&amp;gt;RGB ( c ) (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(8 16 24)))

(defun rh:lst2str ( lst del / str ) (setq str "")  (mapcar '(lambda (x) (setq str (strcat str x del))) lst) (vl-string-right-trim del str))

(defun rh:layer_props ( lyr lst / v ) (setq v (mapcar '(lambda (x) (vlax-get-property lyr x)) lst)))

(defun rh:strlen3 ( str ) (if (&amp;lt; (strlen str) 3) (while (&amp;lt; (strlen str) 3) (setq str (strcat "0" str))) str) str)

(defun rh:hatchbound-p (lst) (cadr (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 330)) lst))))

(defun rh:rhb (ent lyr) (setvar 'clayer lyr) (command "_.-HATCHEDIT" ent "_B" "_R" "_Y"))

(defun c:hatchlayers ( / *error* c_doc c_lyrs sv_lst sv_vals l_props ans ss cnt ent elst lyr l_vals hn cstr clst clr nlyr lobj b_lst m_lst bobj)

  (defun *error* ( msg )
    (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
    (mapcar 'setvar sv_lst sv_vals)
    (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nOops an Error : " msg " occurred.")))
    (princ)
  );_end_*error*_defun

  (setq c_doc (vla-get-activedocument (vlax-get-acad-object))
        c_lyrs (vla-get-layers c_doc)
        sv_lst (list 'cmdecho 'osmode 'hpbound 'clayer)
        sv_vals (mapcar 'getvar sv_lst)
        l_props (list 'truecolor 'linetype 'lineweight);Layer properties list
  );end_setq

  (mapcar 'setvar sv_lst '(0 0 0))

  (initget "Color Name")
  (setq ans (cond ( (getkword "\nSeparate Hatches by : [Color/Name] &amp;lt;Color&amp;gt; ")) ("Color")))

  (prompt "\nSelect Hatches : ")
  (setq ss (ssget '((0 . "HATCH"))))

  (cond (ss
          (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
          (vla-startundomark c_doc)
          (repeat (setq cnt (sslength ss))
            (setq ent (ssname ss (setq cnt (1- cnt)))
                  elst (entget ent)
                  lyr (cdr (assoc 8 elst));Layer
                  l_vals (rh:layer_props (vla-item c_lyrs lyr) l_props);Layer properties
                  hn  (cdr (assoc 2 elst));Hatch pattern name
                  cstr ""
                  clst nil
            );end_setq

            (cond ( (= ans "Color")
                    (foreach x '(62 420 430) (setq clst (cons (cdr (assoc x elst)) clst)))
                    (setq clr (vl-some '(lambda (x) x) clst))
                    (cond ( (not clr) (setq cstr "256"))                ;No Color set (bylayer)
                          ( (and (= (type clr) 'INT) (&amp;lt;= clr 256))      ;ACI (0-256)
                            (setq cstr (rh:strlen3 (itoa clr)))
                          )
                          ( (= (type clr) 'STR) (setq cstr clr))        ;Color Book
                          (t (setq clr (mapcar 'itoa (LM:True-&amp;gt;RGB clr));RGB
                                   cstr (rh:lst2str (mapcar 'rh:strlen3 clr) "_")
                             );end_setq
                          )
                    );end_cond
                    (setq nlyr (strcat lyr "__" cstr))
                  )
                  (t (setq nlyr (strcat lyr "__" hn)))
            );end_cond

            (cond ( (not (tblsearch "layer" nlyr)) (setq lobj (vla-add c_lyrs nlyr)) (mapcar '(lambda (x y) (vlax-put-property lobj x y)) l_props l_vals)))
            (vlax-put-property (vlax-ename-&amp;gt;vla-object ent) 'layer nlyr)
            (if (= 0 (cdr (assoc 71 elst))) (setq b_lst (cons (list ent nlyr) b_lst)) (setq m_lst (cons (list ent nlyr) m_lst)))
          );end_repeat
          (if b_lst (foreach x b_lst (rh:rhb (car x) (cadr x))))
          (cond (m_lst 
                  (foreach y m_lst
                    (setq bobj (vlax-ename-&amp;gt;vla-object (cadr (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 330)) (entget (car y)))))))
                    (vla-copy bobj)
                    (vlax-put-property bobj 'layer (cadr y))
                  );end_foreach
                )
          );end_cond
        )
        (t (alert "NO Hatches Found"))
  );end_cond

  (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
  (mapcar 'setvar sv_lst sv_vals)
  (vla-regen c_doc acAllViewports)
  (princ)
);end_defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 18:24:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9405159#M76693</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-03-27T18:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9538845#M76694</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please is it possible to ask something a little bit different but very near !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have joined the version 1.1 of your beautiful routine which separates hatches (without recreating Boudaries) on many layers depending on either Color or either Hatch Name ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because I imagine that the new routine will be very similar !?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like the same routine to process only for COLOR (So NO question !) but on ANY Entity :&lt;/P&gt;
&lt;P&gt;line, arc, 2D pline heavy or light, 3D pline, circle, ellipse, region, spline, mpolygon, text, mtext, mline, dim, hatch, 3DSolid, 3DSurface, 3DFace, 3DPolyMesh, etc ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance, THE HEALTH (Stay Safe), Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 20:14:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9538845#M76694</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-05-25T20:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9539980#M76695</link>
      <description>&lt;P&gt;I think I understand this, will give it ago over the next couple of days.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 10:44:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9539980#M76695</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-05-26T10:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9540124#M76696</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your future efforts !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please with a standard ACAD selection : all ACAD entities from the selection on unlocked layers ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THE HEALTH (Stay Safe), Regards, Patrice (The Old French EE Froggy)&lt;/P&gt;
&lt;P&gt;Hidden into my bunker ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 11:53:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9540124#M76696</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-05-26T11:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9545274#M76697</link>
      <description>&lt;P&gt;Initial attempt attached. &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not tested as I only have AutoCAD LT with me at present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 08:52:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9545274#M76697</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-05-28T08:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Hatches on multiple Layers depending on Color or Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9545476#M76698</link>
      <description>&lt;P&gt;Hello Mr &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WAOUH Fabulous / Excellent / BRAVO ! ... Your routine is very COMPACT / SHORT !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached my 2 DWGs :&lt;/P&gt;
&lt;P&gt;- ENTITES_2004_1_ORIGINAL&amp;nbsp; :&amp;nbsp; the Original Test DWG (with almost ALL entities)&lt;/P&gt;
&lt;P&gt;- ENTITES_2004_2_E2LBC&amp;nbsp; :&amp;nbsp; the DWG after processing by E2LBC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THANKS, THE HEALTH (Stay Safe), Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 10:27:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/separate-hatches-on-multiple-layers-depending-on-color-or-name/m-p/9545476#M76698</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-05-28T10:27:08Z</dc:date>
    </item>
  </channel>
</rss>

