<?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: Lisp all solid to hatch in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450519#M58451</link>
    <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt; told in his post, always attach sample drawing with current state and what you want to achieve.&lt;/P&gt;&lt;P&gt;It helps us to create code and to grasp&amp;nbsp; your idea i.e. what you actually want to do.&lt;/P&gt;&lt;P&gt;This code will convert solids to hatch (ANSI31 pattern).&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you would probably want is to join all solids to single area, and then hatch it with a singe hatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;To merge hatches to single one you can use code at &lt;A href="https://autocadtips1.com/2011/11/23/autolisp-merge-hatches-join-hatches/" target="_self"&gt;this link.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun c:solids2hatch ( / take pointlist entmakex-hatch ss i )
(defun take (amount lst / ret)(repeat amount (setq ret (cons (car lst) (take (1- amount) (cdr lst))))))
(defun pointlist (lst / ret) (while lst (setq	ret (cons (take 2 lst) ret) lst (cdddr lst))) (reverse ret))
(defun entmakex-hatch (L a n s)
 ;; By ElpanovEvgeniy
 ;; L - list point
 ;; A - angle hatch
 ;; N - name pattern
 ;; S - scale

 ;; returne - hatch ename
 (entmakex
  (apply
   'append
   (list
    (list '(0 . "HATCH")
          '(100 . "AcDbEntity")
          '(410 . "Model")
          '(100 . "AcDbHatch")
          '(10 0.0 0.0 0.0)
          '(210 0.0 0.0 1.0)
          '(2 . "ANSI31")
          (if (= n "SOLID")
           '(70 . 1)
           '(70 . 0)
          ) ;_  if
          '(71 . 0)
          (cons 91 (length l))
    ) ;_  list
    (apply 'append
           (mapcar '(lambda (a)
                     (apply 'append
                            (list (list '(92 . 7) '(72 . 0) '(73 . 1) (cons 93 (length a)))
                                  (mapcar '(lambda (b) (cons 10 b)) a)
                                  '((97 . 0))
                            ) ;_  list
                     ) ;_  apply
                    ) ;_  lambda
                   l
           ) ;_  mapcar
    ) ;_  apply
    (list '(75 . 0)
          '(76 . 1)
          (cons 52 a)
          (cons 41 s)
          '(77 . 0)
          '(78 . 1)
          (cons 53 a)
          '(43 . 0.)
          '(44 . 0.)
          '(45 . 1.)
          '(46 . 1.)
          '(79 . 0)
          '(47 . 1.)
          '(98 . 2)
          '(10 0. 0. 0.0)
          '(10 0. 0. 0.0)
          '(451 . 0)
          '(460 . 0.0)
          '(461 . 0.0)
          '(452 . 1)
          '(462 . 1.0)
          '(453 . 2)
          '(463 . 0.0)
          '(463 . 1.0)
          '(470 . "LINEAR")
    ) ;_  list
   ) ;_  list
  ) ;_  apply
 ) ;_  entmakex
) ;_  defun

	(setq ss (ssget '((0 . "SOLID"))) i -1)
	(while (&amp;lt; (setq i (1+ i)) (sslength ss))
		(entmakex-hatch (list(pointlist (vlax-get (vlax-ename-&amp;gt;vla-object (ssname ss i)) 'Coordinates))) 0 "ANSI31" 1 )
		(entdel (ssname ss i))
	)
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, select is as a solution.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 18:02:19 GMT</pubDate>
    <dc:creator>hak_vz</dc:creator>
    <dc:date>2021-07-07T18:02:19Z</dc:date>
    <item>
      <title>Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450385#M58449</link>
      <description>&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-change-all-selected-hatches-to-solid/td-p/3394433" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-change-all-selected-hatches-to-solid/td-p/3394433&lt;/A&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Hello everybody. I saw this post on the forum&lt;BR /&gt;&lt;BR /&gt;I would like to know if it is possible to do the reverse with a lisp? Transform all solid of the drawing into hatch, without having to do selection. it's possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 16:59:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450385#M58449</guid>
      <dc:creator>renanemeyer</dc:creator>
      <dc:date>2021-07-07T16:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450483#M58450</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5143450"&gt;@renanemeyer&lt;/a&gt;&amp;nbsp;wrote:&lt;SPAN class="Y2IQFc"&gt;&lt;BR /&gt;&lt;BR /&gt;I would like to know if it is possible to do the reverse with a lisp? Transform all solid of the drawing into hatch, without having to do selection. it's possible?&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Transform to what hatch pattern ? If want the "no selection" mode,&amp;nbsp; you need to hardcode the target hatch pattern name on the code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Drawing sample perhaps?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 17:35:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450483#M58450</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-07-07T17:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450519#M58451</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt; told in his post, always attach sample drawing with current state and what you want to achieve.&lt;/P&gt;&lt;P&gt;It helps us to create code and to grasp&amp;nbsp; your idea i.e. what you actually want to do.&lt;/P&gt;&lt;P&gt;This code will convert solids to hatch (ANSI31 pattern).&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you would probably want is to join all solids to single area, and then hatch it with a singe hatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;To merge hatches to single one you can use code at &lt;A href="https://autocadtips1.com/2011/11/23/autolisp-merge-hatches-join-hatches/" target="_self"&gt;this link.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun c:solids2hatch ( / take pointlist entmakex-hatch ss i )
(defun take (amount lst / ret)(repeat amount (setq ret (cons (car lst) (take (1- amount) (cdr lst))))))
(defun pointlist (lst / ret) (while lst (setq	ret (cons (take 2 lst) ret) lst (cdddr lst))) (reverse ret))
(defun entmakex-hatch (L a n s)
 ;; By ElpanovEvgeniy
 ;; L - list point
 ;; A - angle hatch
 ;; N - name pattern
 ;; S - scale

 ;; returne - hatch ename
 (entmakex
  (apply
   'append
   (list
    (list '(0 . "HATCH")
          '(100 . "AcDbEntity")
          '(410 . "Model")
          '(100 . "AcDbHatch")
          '(10 0.0 0.0 0.0)
          '(210 0.0 0.0 1.0)
          '(2 . "ANSI31")
          (if (= n "SOLID")
           '(70 . 1)
           '(70 . 0)
          ) ;_  if
          '(71 . 0)
          (cons 91 (length l))
    ) ;_  list
    (apply 'append
           (mapcar '(lambda (a)
                     (apply 'append
                            (list (list '(92 . 7) '(72 . 0) '(73 . 1) (cons 93 (length a)))
                                  (mapcar '(lambda (b) (cons 10 b)) a)
                                  '((97 . 0))
                            ) ;_  list
                     ) ;_  apply
                    ) ;_  lambda
                   l
           ) ;_  mapcar
    ) ;_  apply
    (list '(75 . 0)
          '(76 . 1)
          (cons 52 a)
          (cons 41 s)
          '(77 . 0)
          '(78 . 1)
          (cons 53 a)
          '(43 . 0.)
          '(44 . 0.)
          '(45 . 1.)
          '(46 . 1.)
          '(79 . 0)
          '(47 . 1.)
          '(98 . 2)
          '(10 0. 0. 0.0)
          '(10 0. 0. 0.0)
          '(451 . 0)
          '(460 . 0.0)
          '(461 . 0.0)
          '(452 . 1)
          '(462 . 1.0)
          '(453 . 2)
          '(463 . 0.0)
          '(463 . 1.0)
          '(470 . "LINEAR")
    ) ;_  list
   ) ;_  list
  ) ;_  apply
 ) ;_  entmakex
) ;_  defun

	(setq ss (ssget '((0 . "SOLID"))) i -1)
	(while (&amp;lt; (setq i (1+ i)) (sslength ss))
		(entmakex-hatch (list(pointlist (vlax-get (vlax-ename-&amp;gt;vla-object (ssname ss i)) 'Coordinates))) 0 "ANSI31" 1 )
		(entdel (ssname ss i))
	)
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, select is as a solution.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 18:02:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450519#M58451</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-07-07T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450558#M58452</link>
      <description>&lt;P&gt;Thanks pbejse&lt;BR /&gt;Thanks hack_vz&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;"&lt;SPAN&gt;Transform to what hatch pattern ?"&amp;nbsp;&lt;/SPAN&gt;its for just simple hatch&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;its not working for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I was trying to develop one that I wouldn't need to select for hatching I have this as an example, but you select the solid and then it turns it into a hatch&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun convert2dsolids (/ 2dcoords coords count hatch obj pline space ss)
  (and (setq ss (ssget '((0 . "SOLID"))))
       (setq count -1)
       (setq space (get_space))
       (while (&amp;lt; (setq count (1+ count))
		 (sslength ss))
	 (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss count)))
	 (setq coords (vlax-get obj 'coordinates))
	 (setq 2dcoords (list (car coords)(cadr coords)))
	 (setq coords (cdr (cdr (cdr coords))))
	 (setq 2dcoords (append 2dcoords (list (car coords)(cadr coords))))
	 (setq coords (cdr (reverse (cdr (cdr (cdr coords))))))
	 (setq 2dcoords (append 2dcoords (list (cadr coords)(car coords))))
	 (setq coords (reverse coords)) (setq 2dcoords (append 2dcoords (list (car coords)(cadr coords))))
	 (setq pline (vlax-invoke space 'addlightweightpolyline 2dcoords))
	 (vla-put-closed pline :vlax-true)
	 (setq hatch (vlax-invoke space 'addhatch acHatchPatternTypePredefined "SOLID" :vlax-true))
	 (vlax-invoke hatch 'appendouterloop (list pline))
	 (vla-put-color pline (vla-get-color obj))
	 (vla-put-color hatch (vla-get-color obj))
	 (vla-put-layer pline (vla-get-layer obj))
	 (vla-put-layer hatch (vla-get-layer obj))
	 (vla-delete obj)
         (vla-delete pline)
	 )
       )
  );; convert2dsolids

(defun c:SolidToHatch ()
  (convert2dsolids)
  (princ)
);; SolidToHatch&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Jul 2021 18:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450558#M58452</guid>
      <dc:creator>renanemeyer</dc:creator>
      <dc:date>2021-07-07T18:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450562#M58453</link>
      <description>&lt;P&gt;Here's another quickie:&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:foo (/ el h p p2 pl s sp x)
  ;; RJP » 2021-07-07
  ;; Converts solids to hatches
  (if (setq s (ssget "_X" '((0 . "SOLID"))))
    (progn
      (foreach e (mapcar 'cadr (ssnamex s))
	(setq el (entget e))
	(setq sp (vlax-ename-&amp;gt;vla-object (cdr (assoc 330 el))))
	(setq p (mapcar 'cdr (vl-remove-if-not '(lambda (x) (member (car x) '(10 11 12 13))) el)))
	(setq p2 (list (car p) (cadr p) (last p) (caddr p)))
	(setq pl (entmakex (apply 'append
				  (list	(list '(0 . "LWPOLYLINE")
					      '(100 . "AcDbEntity")
					      (assoc 8 el)
					      (cons 100 "AcDbPolyline")
					      '(90 . 4)
					      '(70 . 1)
					)
					(mapcar '(lambda (x) (list 10 (car x) (cadr x))) p2)
				  )
			   )
		 )
	)
	(setq h (vlax-invoke sp 'addhatch achatchobject "SOLID" :vlax-true))
	(vlax-invoke h 'appendouterloop (list (vlax-ename-&amp;gt;vla-object pl)))
	(vla-put-layer h (cdr (assoc 8 el)))
	(entdel e)
      )
    )
  )
  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Jul 2021 18:08:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450562#M58453</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-07-07T18:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450582#M58454</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's the second time today you've helped my lisp.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&amp;nbsp; thank you so much!! its perfect&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 18:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450582#M58454</guid>
      <dc:creator>renanemeyer</dc:creator>
      <dc:date>2021-07-07T18:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450598#M58455</link>
      <description>&lt;P&gt;My code works ok. Anyway you have &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt; 's code that works for you.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 18:24:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450598#M58455</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-07-07T18:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450616#M58456</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5143450"&gt;@renanemeyer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's the second time today you've helped my lisp.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&amp;nbsp; thank you so much!! its perfect&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Glad to help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clinking_beer_mugs:"&gt;🍻&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 18:30:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/10450616#M58456</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-07-07T18:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14142332#M171194</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;unfortunately i'm really bad for writing Lisp. could it be possible to modify the lisp in order to select items instead of converting all objects in the file?&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2026 14:33:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14142332#M171194</guid>
      <dc:creator>philsogood</dc:creator>
      <dc:date>2026-05-26T14:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14142405#M171195</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564941"&gt;@philsogood&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;..... could it be possible to modify the lisp in order to select items instead of converting all objects in the file?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you're talking about the accepted-solution routine in Message 5, you should be able to do that by simply removing the&lt;FONT face="courier new,courier" color="#000000"&gt;&lt;STRONG&gt; "_X"&lt;/STRONG&gt; &lt;/FONT&gt;[= find everything] selection mode element:&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;  (if (setq s (ssget '((0 . "SOLID"))))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; Not quite, after all, at least sometimes.&amp;nbsp; With only that change, this part:&lt;/P&gt;
&lt;PRE class="lia-code-sample line-numbers language-lisp" tabindex="0"&gt;&lt;CODE&gt;(foreach e (mapcar 'cadr (ssnamex s))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will step through a list that, depending on &lt;EM&gt;the way the Solids were selected&lt;/EM&gt;, may contain items other than only entity names of Solids, that relate to the selection method(s).&amp;nbsp; Later I'll try posting something to have it process only the entity names, if someone doesn't beat me to it.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;&lt;STRONG&gt;Further EDIT:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; I notice that some suggestions [including the accepted one] involve first converting the Solids to Polylines, and then Hatching the resulting Polylines.&amp;nbsp; That's a waste -- the Hatches can be drawn directly from the Solids' information, without the middleman.&amp;nbsp; I worked on an approach that does that, and does not have the list problem, and works in any UCS, and prevents selection of Solids on locked Layers, and has an option to retain or delete the Solids, and so on, but questions arise:&lt;/P&gt;
&lt;P&gt;Would one want to convert all Solids to Hatches always in the SOLID pattern [if the only purpose is to change the object type but not the appearance], or some other always pattern, or have the option to specify the pattern name?&lt;BR /&gt;Would one want the option of a Hatch of lines [&lt;EM&gt;not&lt;/EM&gt; SOLID] over &lt;EM&gt;retained&lt;/EM&gt; Solids, contrasting in color and maybe on different Layers, or should the Hatch always get all properties of the Solid [which would make the Hatch invisible if Solids are retained]?&lt;/P&gt;
&lt;P&gt;If contrasting, should that be done by keeping the Solid behind the Hatch, or using a background color in the Hatch itself?&lt;/P&gt;
&lt;P&gt;If overlaying like that, should pulling the Hatch to the front in draw order be built in?&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2026 17:38:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14142405#M171195</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2026-05-26T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14142704#M171197</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564941"&gt;@philsogood&lt;/a&gt;&amp;nbsp;Try this update for user selection:&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:foo (/ el h p p2 pl s sp x)
  ;; Converts solids to hatches
  (if (setq s (ssget '((0 . "SOLID"))))
    (progn
      (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
	(setq el (entget e))
	(or sp (setq sp (vlax-ename-&amp;gt;vla-object (cdr (assoc 330 el)))))
	(setq p (mapcar 'cdr (vl-remove-if-not '(lambda (x) (member (car x) '(10 11 12 13))) el)))
	(setq p2 (list (car p) (cadr p) (last p) (caddr p)))
	(setq pl (entmakex (apply 'append
				  (list	(list '(0 . "LWPOLYLINE")
					      '(100 . "AcDbEntity")
					      (assoc 8 el)
					      (cons 100 "AcDbPolyline")
					      '(90 . 4)
					      '(70 . 1)
					)
					(mapcar '(lambda (x) (list 10 (car x) (cadr x))) p2)
				  )
			   )
		 )
	)
	(setq h (vlax-invoke sp 'addhatch achatchobject "SOLID" :vlax-true))
	(vlax-invoke h 'appendouterloop (list (vlax-ename-&amp;gt;vla-object pl)))
	(vla-put-layer h (cdr (assoc 8 el)))
	(entdel e)
      )
    )
  )
  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 May 2026 19:19:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14142704#M171197</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2026-05-26T19:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp all solid to hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14150677#M171282</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;!! = )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2026 08:29:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-all-solid-to-hatch/m-p/14150677#M171282</guid>
      <dc:creator>philsogood</dc:creator>
      <dc:date>2026-06-02T08:29:12Z</dc:date>
    </item>
  </channel>
</rss>

