<?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 Simple hatch on previously drawn object in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976030#M48540</link>
    <description>&lt;P&gt;I want to do something seemingly simple but my lack of programming chops is not allowing me to get it. I need to draw a multiline with closed ends, then add a hatch to that. It works to add the hatch to the object manually after I draw it, is it possible to do this with LISP? I have tried a few different approaches none of which work. Here are some of my attempts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:GUTTER ( )&lt;/P&gt;&lt;P&gt;(command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;BR /&gt;(vl-cmdf "MLINE" "J" "Z" "S" "1" "ST" "GUTTER")&amp;nbsp;;; DRAW MULTILINE&lt;/P&gt;&lt;P&gt;(command "_-HATCH" ".PREVIOUS" "SOLID" "") ;; HATCH W/ SOLID&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:GUTTER ( / EL )&lt;/P&gt;&lt;P&gt;(command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;BR /&gt;(vl-cmdf "MLINE" "J" "Z" "S" "1" "ST" "GUTTER")&amp;nbsp;;; DRAW MULTILINE&lt;/P&gt;&lt;P&gt;(setq EL (entlast))&lt;BR /&gt;(if (/= EL (entlast))&lt;BR /&gt;(command "_-hatch" "_S" "_L" "" "_P" "SOLID" "" "" "")&lt;BR /&gt;); end if&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:GUTTER ( )&lt;/P&gt;&lt;P&gt;(command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;/P&gt;&lt;P&gt;(command&lt;/P&gt;&lt;P&gt;"_.MLINE" "J" "Z" "S" "1" "ST" "GUTTER"&lt;/P&gt;&lt;P&gt;"_.bhatch" "_advanced" "_associativity" "_yes" "" "_select" "_last" "" ""&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Feb 2022 19:50:22 GMT</pubDate>
    <dc:creator>murmanator</dc:creator>
    <dc:date>2022-02-28T19:50:22Z</dc:date>
    <item>
      <title>Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976030#M48540</link>
      <description>&lt;P&gt;I want to do something seemingly simple but my lack of programming chops is not allowing me to get it. I need to draw a multiline with closed ends, then add a hatch to that. It works to add the hatch to the object manually after I draw it, is it possible to do this with LISP? I have tried a few different approaches none of which work. Here are some of my attempts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:GUTTER ( )&lt;/P&gt;&lt;P&gt;(command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;BR /&gt;(vl-cmdf "MLINE" "J" "Z" "S" "1" "ST" "GUTTER")&amp;nbsp;;; DRAW MULTILINE&lt;/P&gt;&lt;P&gt;(command "_-HATCH" ".PREVIOUS" "SOLID" "") ;; HATCH W/ SOLID&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:GUTTER ( / EL )&lt;/P&gt;&lt;P&gt;(command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;BR /&gt;(vl-cmdf "MLINE" "J" "Z" "S" "1" "ST" "GUTTER")&amp;nbsp;;; DRAW MULTILINE&lt;/P&gt;&lt;P&gt;(setq EL (entlast))&lt;BR /&gt;(if (/= EL (entlast))&lt;BR /&gt;(command "_-hatch" "_S" "_L" "" "_P" "SOLID" "" "" "")&lt;BR /&gt;); end if&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:GUTTER ( )&lt;/P&gt;&lt;P&gt;(command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;/P&gt;&lt;P&gt;(command&lt;/P&gt;&lt;P&gt;"_.MLINE" "J" "Z" "S" "1" "ST" "GUTTER"&lt;/P&gt;&lt;P&gt;"_.bhatch" "_advanced" "_associativity" "_yes" "" "_select" "_last" "" ""&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 19:50:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976030#M48540</guid>
      <dc:creator>murmanator</dc:creator>
      <dc:date>2022-02-28T19:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976097#M48541</link>
      <description>&lt;P&gt;Fixed the first one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:gutter ()
  
  (command "_-layer" "m" "plumbing" "") ;; change layer to "plumbing"
  (command "mline" "j" "z" "s" "1" "st" "gutter") ;; draw multiline
  (while (&amp;gt; (getvar 'cmdactive) 0) (command pause))
  (command "_-hatch" "_select" "_last" "" "properties" "solid" "") ;; hatch w/ solid
  (princ)
  )
&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Feb 2022 20:34:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976097#M48541</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-02-28T20:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976114#M48542</link>
      <description>&lt;P&gt;Or, with Acad 2015 [I think] or newer:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:GUTTER ()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (command "_-layer" "s" "PLUMBING" "") ;; CHANGE LAYER TO "PLUMBING"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (command&lt;FONT size="4" color="#0000FF"&gt;&lt;STRONG&gt;-s&lt;/STRONG&gt;&lt;/FONT&gt; "_.MLINE" "J" "Z" "S" "1" "ST" "GUTTER")&lt;FONT color="#00CCFF"&gt;; will let you finish it before:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (command "_.bhatch" "_advanced" "_associativity" "_yes" "" "_select" "_last" "" "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 20:44:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976114#M48542</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-02-28T20:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976130#M48543</link>
      <description>&lt;P&gt;Thanks guys, both of those look like they want to work but I keep getting "Unable to fill the boundary with solid." in the command line at the end. I swear I was able to manually hatch a multiline by selecting the object before but now its not working, either manually or via the lisp. Sorry I know this is not a lisp question but do you know if hatching a multiline is possible? It has the start and end lines so it looks like a closed object. Does the MLSTYLE settings have anything to do with it? Because Ive been tinkering with those since I started all this.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 20:52:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976130#M48543</guid>
      <dc:creator>murmanator</dc:creator>
      <dc:date>2022-02-28T20:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976134#M48544</link>
      <description>&lt;P&gt;Well I must have done something goofy to the file I was working in to the multiline styles. I went into a new drawing and it seems to work now. Thanks guys always appreciate the help on here.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 20:57:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976134#M48544</guid>
      <dc:creator>murmanator</dc:creator>
      <dc:date>2022-02-28T20:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976140#M48545</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3383350"&gt;@murmanator&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... do you know if hatching a multiline is possible? It has the start and end lines so it looks like a closed object. Does the MLSTYLE settings have anything to do with it? ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does your "GUTTER" MultiLine Style include the closed ends in its definition?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1646081962406.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1030762i0083253123ECB025/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1646081962406.png" alt="Kent1Cooper_0-1646081962406.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When I use this Test Style with closed ends incorporated in it, I can Hatch the resulting MLine by object selection.&amp;nbsp; I can't if I use a Style without the end caps.&amp;nbsp; If I draw Lines across the ends, I can then Hatch by picking an internal point, but not by object selection of the Mline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 21:03:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976140#M48545</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-02-28T21:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976152#M48546</link>
      <description>&lt;P&gt;Thanks Kent. Yeah I do have the ends included. I must have inadvertently done something to either my mlstyles or hatch settings in my test file because it was not allowing me to hatch by selection ANY mlines. When I went to a new drawing it all worked fine.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 21:10:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10976152#M48546</guid>
      <dc:creator>murmanator</dc:creator>
      <dc:date>2022-02-28T21:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple hatch on previously drawn object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10978627#M48547</link>
      <description>&lt;P&gt;You can make line styles on the fly so your gutter could be different widths, as well as linetype and colours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; make mline 
; By alan H oct 2020
; Set to bylayer at moment
; Thanks to FIXO for original code

(defun c:makml ( / lst1 lst2 lst desc MLINE_STYLE_NAME )
(setq 	MLINE_STYLE_NAME (getstring "\nEnter mline name ")
		desc (getstring "\nEnter description ")
)
(while (setq off (getreal "\Enter offset Enter to finish " ))
	(setq lst (cons off lst))
)
(if (= desc nil)(setq desc MLINE_STYLE_NAME))
(setq lst1
	(list '(0 . "MLINESTYLE")
		'(100 . "AcDbMlineStyle")
		(cons 2 MLINE_STYLE_NAME)
		(cons 70 (+ 272))
		(cons 3 desc)
		'(62 . 256)
		'(51 . 1.5708)
		'(52 . 1.5708)
		'(71 . 4)
    '(72 . 4)
   	)
)
(setq x (length lst))
(repeat x
	(setq lst2 (list 
		(cons 49 (nth (setq x (- x 1)) lst))
		(cons 62 256)
		(cons 6 "BYLAYER")
		)
	)
	(setq lst1 (append lst1 lst2))
)
(if
	(not (dictadd
		(cdar (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))
		MLINE_STYLE_NAME
		(entmakex lst1)
		)
	)
	(Alert "Impossible to create mline style\n perhaps this was exist earlier")
)
(setvar 'cmlstyle MLINE_STYLE_NAME)
(princ)
)
(c:makml)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 03:41:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-hatch-on-previously-drawn-object/m-p/10978627#M48547</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-03-02T03:41:52Z</dc:date>
    </item>
  </channel>
</rss>

