<?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: Full automatic hatching in specific layer- AutoCAD LT in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197622#M5407</link>
    <description>&lt;P&gt;Thanks Moshe ans Kent, both solutions work just fine. I'm very new in LISP and this should taken me a very long time to achieve this. Thank you very much.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2024 16:55:31 GMT</pubDate>
    <dc:creator>infoGM8C2</dc:creator>
    <dc:date>2024-12-06T16:55:31Z</dc:date>
    <item>
      <title>Full automatic hatching in specific layer- AutoCAD LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13195729#M5403</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Professionally i work a lot with city-plans. For each plan i have to hatch all closed polygones on the layer BGB1 at a scale of 15 and all closed polygons on layer BGB2 at a scale of 10.&lt;/P&gt;
&lt;P&gt;Is it possible to automate this completly without any intervention?&lt;/P&gt;
&lt;P&gt;I attached example-files, The DXF is the data and the dwg is what I should get.&lt;/P&gt;
&lt;P&gt;Thanks in advance for all the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9532213"&gt;@infoGM8C2&lt;/a&gt;&amp;nbsp;- Moderation team edited title for clarity.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 21:25:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13195729#M5403</guid>
      <dc:creator>infoGM8C2</dc:creator>
      <dc:date>2024-12-05T21:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Full automatic hatching in specific layer- AutoCAD LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13196806#M5404</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9532213"&gt;@infoGM8C2&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check this CUSHAT command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;enjoy&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(vl-load-com) ; load activex support
; Custom Hatch
(defun c:cushat (/ _layers ; local function
		   LAYER&amp;amp;SCALE adoc ss data ename AcDbModelSpace AcDbHatch outLoop)

 ; anonymous function
 (setq _layers (lambda (lst) (substr (apply 'strcat (mapcar (function (lambda (e) (strcat "," (car e)))) lst)) 2)))

 (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
 (vla-startUndoMark adoc) 
  
 (setq LAYER&amp;amp;SCALE '(("gbg1" . 15) ("gbg2" . 10))) ; may be modified with new layers &amp;amp; scales

 (if (setq ss (ssget "_X" (list '(0 . "polyline,lwpolyline") (cons '8 (_layers LAYER&amp;amp;SCALE)) '(70 . 1))))
  (progn
   (setq AcDbModelSpace (vla-get-modelSpace adoc))
   
   (foreach data LAYER&amp;amp;SCALE
    (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
					       
     (if (eq (strcase (cdr (assoc '8 (entget ename)))) (strcase (car data)))
      (progn
       (setq AcDbHatch (vla-addHatch AcDbModelSpace acHatchPatternTypePredefined "ansi31" :vlax-true))
       (setq outerLoop (vlax-make-safearray vlax-vbObject '(0 . 0)))
       (vlax-safearray-put-element outerLoop 0 (vlax-ename-&amp;gt;vla-object ename))
       (vla-put-layer AcDbhatch (car data))
       (vla-put-patternScale AcDbhatch (cdr data))
       (vla-AppendOuterLoop AcDbHatch outerLoop)
       (vla-Evaluate AcDbHatch)
       (vlax-release-object AcDbHatch)
      ); progn
     ); if
					       
    ); foreach
   ); foreach

   (vlax-release-object AcDbModelSpace)
  ); progn
 ); if

 (vla-endUndoMark adoc)
 (vlax-release-object adoc)
  
 (princ)
); c:cushat&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 10:54:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13196806#M5404</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-12-06T10:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Full automatic hatching in specific layer- AutoCAD LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197092#M5405</link>
      <description>&lt;P&gt;Correcting your "BGB" to "GBG" to agree with the Layer names in the drawing....&lt;/P&gt;
&lt;P&gt;If you have a new-enough version of LT to be able to use AutoLisp, it can be as simple as this [lightly tested]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:DOIT (/ ss)
  (foreach entry '(("GBG1" 15) ("GBG2" 10))
    (if (setq ss (ssget "_X" (list '(0 . "LWPOLYLINE") (cons 8 (car entry)) '(-4 . "&amp;amp;") '(70 . 1))))
      (progn ; then
        (setvar 'clayer (car entry))
        (command "_.hatch" "ANSI31" (cadr entry) 0 ss "")
      ); progn
    ); if
  ); foreach
  (prin1)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sample drawing has only "lightweight" Polylines.&amp;nbsp; If "heavy" ones might also be included, change "LWPOLYLINE" to "*POLYLINE".&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:31:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197092#M5405</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-12-06T13:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Full automatic hatching in specific layer- AutoCAD LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197115#M5406</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9532213"&gt;@infoGM8C2&lt;/a&gt;Are you aware of the variables CLAYER or HPLAYER (sets the layer), HPNAME (sets the hatch pattern), and HPSCALE (sets the hatch scale) that have been around for quite some time to do what you want all this time?&lt;BR /&gt;And simple macro buttons (or if you must have it, a LISP) in your LT version pretty much would have gotten you there?&lt;BR /&gt;&lt;BR /&gt;SYSVARMONITOR command can be used to always ensure those hatch-specific three variables are always set the way you want too &lt;A href="https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-82BACF96-AC90-446A-8E60-3CC3072F8060" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-82BACF96-AC90-446A-8E60-3CC3072F8060&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here is the full list of Hatch Pattern Variables if you wish to explore, there are some gems in there:&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-B94870E7-49CE-4BB0-A978-382A38E1FED8#:~:text=HPANG%20(System%20Variable,HPTRANSPARENCY%20(System%20Variable" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-B94870E7-49CE-4BB0-A978-382A38E1FED8#:~:text=HPANG%20(System%20Variable,HPTRANSPARENCY%20(System%20Variable&lt;/A&gt;)&lt;BR /&gt;&lt;BR /&gt;HPANG (System Variable)&lt;BR /&gt;HPANNOTATIVE (System Variable)&lt;BR /&gt;HPASSOC (System Variable)&lt;BR /&gt;HPBACKGROUNDCOLOR (System Variable)&lt;BR /&gt;HPBOUND (System Variable)&lt;BR /&gt;HPBOUNDRETAIN (System Variable)&lt;BR /&gt;HPCOLOR (System Variable)&lt;BR /&gt;HPDLGMODE (System Variable)&lt;BR /&gt;HPDOUBLE (System Variable)&lt;BR /&gt;HPDRAWMODE (System Variable)&lt;BR /&gt;HPDRAWORDER (System Variable)&lt;BR /&gt;HPGAPTOL (System Variable)&lt;BR /&gt;HPINHERIT (System Variable)&lt;BR /&gt;HPISLANDDETECTION (System Variable)&lt;BR /&gt;HPISLANDDETECTIONMODE (System Variable)&lt;BR /&gt;HPLAYER (System Variable)&lt;BR /&gt;HPLINETYPE (System Variable)&lt;BR /&gt;HPMAXAREAS (System Variable)&lt;BR /&gt;HPMAXLINES (System Variable)&lt;BR /&gt;HPNAME (System Variable)&lt;BR /&gt;HPOBJWARNING (System Variable)&lt;BR /&gt;HPORIGIN (System Variable)&lt;BR /&gt;HPORIGINMODE (System Variable)&lt;BR /&gt;HPPATHALIGNMENT (System Variable)&lt;BR /&gt;HPPATHWIDTH (System Variable)&lt;BR /&gt;HPPICKMODE (System Variable)&lt;BR /&gt;HPQUICKPREVIEW (System Variable)&lt;BR /&gt;HPQUICKPREVTIMEOUT (System Variable)&lt;BR /&gt;HPSCALE (System Variable)&lt;BR /&gt;HPSEPARATE (System Variable)&lt;BR /&gt;HPSPACE (System Variable)&lt;BR /&gt;HPTRANSPARENCY (System Variable)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 16:47:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197115#M5406</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2024-12-06T16:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Full automatic hatching in specific layer- AutoCAD LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197622#M5407</link>
      <description>&lt;P&gt;Thanks Moshe ans Kent, both solutions work just fine. I'm very new in LISP and this should taken me a very long time to achieve this. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 16:55:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/full-automatic-hatching-in-specific-layer-autocad-lt/m-p/13197622#M5407</guid>
      <dc:creator>infoGM8C2</dc:creator>
      <dc:date>2024-12-06T16:55:31Z</dc:date>
    </item>
  </channel>
</rss>

