<?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 or command for square with red hatch in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9904593#M97745</link>
    <description>&lt;P&gt;This seems to work perfectly!&lt;/P&gt;&lt;P&gt;Can't thank you enough!&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 15:59:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-30T15:59:37Z</dc:date>
    <item>
      <title>Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358325#M97725</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a lisp or a command that allows me to create a square (not always a rectangle) with a black edge and a red hatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If also possible i'ld like to follow it up by a dimension of a specific "dimension style".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks advance for your time and effort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 09:13:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358325#M97725</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-25T09:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358347#M97726</link>
      <description>&lt;P&gt;Post a dwg to have a look.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any layer preference? Or just current?&lt;/P&gt;
&lt;P&gt;Which autocad version you have?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, try this easy one... simple to learn of.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:RectangleFilled ( / ocl)
  (setq ocl (getvar 'CECOLOR))
  (setvar 'CECOLOR "7")
  (command-s "_.RECTANG")
  (setvar 'CECOLOR "1")
  (command "_.BHATCH" "_S" "_L" "" "")
  (command "_.DIMSTYLE" "_Re" "ISO-25")
  (setvar 'CECOLOR ocl)
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Oct 2018 09:35:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358347#M97726</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-10-25T09:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358708#M97727</link>
      <description>&lt;P&gt;Hi thanks for the time and effort&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the rectangle function isn't exactly what I'm looking for.&lt;/P&gt;&lt;P&gt;Sometimes the square will be at an angle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oblique angle.PNG" style="width: 394px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/561808i438C411E98F1E739/image-size/large?v=v2&amp;amp;px=999" role="button" title="Oblique angle.PNG" alt="Oblique angle.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm using Autocad 2019&lt;/P&gt;&lt;P&gt;Preferably it'll start in layer 0 with lineweights of 0.09mm (or by layer).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 11:49:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358708#M97727</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-25T11:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358740#M97728</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sometimes the square will be at an angle&amp;nbsp;&amp;nbsp;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sure, why not - still can be done with the RECTANG command.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 12:18:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8358740#M97728</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-10-25T12:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359200#M97729</link>
      <description>&lt;P&gt;It doesn't seem to work with oblique angles.&lt;/P&gt;&lt;P&gt;Below you'll see why, this is after I've selected the first point.&lt;/P&gt;&lt;P&gt;Autocad automatically assumes a Rectangular square along x-y.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oblique angle02.PNG" style="width: 928px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/561885iA0BDFBB416D385F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Oblique angle02.PNG" alt="Oblique angle02.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The command "solid" seem more what I need, but doesnt have a black border.&lt;/P&gt;&lt;P&gt;Still thanks for the help though...&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 13:57:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359200#M97729</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-25T13:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359206#M97730</link>
      <description>&lt;P&gt;How would you want the User to give input for the location and size of that square/rectangle?&amp;nbsp; Will those long Lines [or Rays or Xlines?] always be there already?&amp;nbsp; Should the User pick points on them, or pick one corner and be prompted for a length along them, or....?&amp;nbsp; Do you want the outline of the square/rectangle as a closed Polyline [such as the RECTANG command makes], or could the longer Lines form two sides and the other two sides be only Lines across the space&amp;nbsp;between those?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're going to use&amp;nbsp;the Solid Hatch pattern, I recommend you consider a SOLID [of the 2D variety] instead.&amp;nbsp; It takes less memory, and will Stretch along with the surroundings if you make that kind of change [a Hatch pattern made with a (command)-function Hatch command &lt;EM&gt;won't be associative&lt;/EM&gt;, even if that's the current setting for Hatching, so if you Stretch the surroundings, you'll then have to grip-edit the Hatch to the&amp;nbsp;changed outline].&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 13:58:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359206#M97730</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-10-25T13:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359225#M97731</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp; Autocad automatically assumes a Rectangular square along x-y. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to have missed the fact that there's a&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#0000ff"&gt;R&lt;/FONT&gt;&lt;FONT color="#000000"&gt;otation option&lt;/FONT&gt;&lt;/STRONG&gt; in RECTANG after you've given it the first point [in new-enough versions, which you have].&amp;nbsp; Note the "or" at the end of the prompt box, and the pull-down list.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 14:04:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359225#M97731</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-10-25T14:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359326#M97732</link>
      <description>&lt;P&gt;How about like this, is it better now?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:RectangleFilled ( / ocl)
  (setq ocl (getvar 'CECOLOR))
  (setvar 'CECOLOR "7")
  (command "_.RECTANG" pause "_Rotation" "_Pick" "@" (getpoint (getvar 'lastpoint)) pause)
  (setvar 'CECOLOR "1")
  (command "_.BHATCH" "_S" "_L" "" "")
  (command "_.DIMSTYLE" "_Re" "&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;YourDimStyle&lt;/STRONG&gt;&lt;/FONT&gt;")
  (setvar 'CECOLOR ocl)
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You can also add (setvar 'hpname "solid") if that is pattern you use.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 14:39:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359326#M97732</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-10-25T14:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359390#M97733</link>
      <description>&lt;P&gt;Yesss, that's almost perfect!&lt;/P&gt;&lt;P&gt;The hatch however seems to be the last type I've used, instead of a solid.&lt;/P&gt;&lt;P&gt;And the dim-action doesn't seem to activate. If you could only help with the solidhatching I'ld be so gratefull.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for everybody's help so far, you've been magnificent!&lt;/P&gt;&lt;P&gt;I'm trying to study up on lisp but I'm still far from knowing anything&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 14:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359390#M97733</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-25T14:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359436#M97734</link>
      <description>&lt;P&gt;Sure! Also added a feature to activate your dim&amp;nbsp;action! I hope the right one.&lt;/P&gt;
&lt;P&gt;Still need to fill your DIM style... which has to be defined in the drawing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:RectangleFilled ( / ocl)
  (setq ocl (getvar 'CECOLOR))
  (setvar 'CECOLOR "7")
  (command "_.RECTANG" pause "_Rotation" "_Pick" "@" (getpoint (getvar 'lastpoint)) pause)
  (setvar 'CECOLOR "1")
  (command "_.BHATCH" "_P" "_Solid" "_S" "_L" "" "")
  (command "_.DIMSTYLE" "_Re" "YourDimStyle")
  (setvar 'CECOLOR ocl)
  (initcommandversion)
  (command "_DIM")
  (princ)
)&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 25 Oct 2018 15:13:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359436#M97734</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-10-25T15:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359592#M97735</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;....
  (command "_DIM")
....&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the images, I'd go for:&lt;/P&gt;
&lt;P&gt;(command "_.&lt;FONT color="#000000"&gt;&lt;STRONG&gt;dimaligned&lt;/STRONG&gt;&lt;/FONT&gt;")&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 16:05:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8359592#M97735</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-10-25T16:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8361100#M97736</link>
      <description>&lt;P&gt;Perfecttt !!!&lt;/P&gt;&lt;P&gt;That's point on, 100% what I was looking for.&lt;/P&gt;&lt;P&gt;Works excellent with the dimstyle and everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everybody for your time and effort, it may look like a simple command but it's one we use frequently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 08:11:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8361100#M97736</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-26T08:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8361786#M97737</link>
      <description>&lt;P&gt;Would it be possible to add one more option?&lt;/P&gt;&lt;P&gt;After I've placed the dimension (only one, if that helps) the dimstyle should return to another (or previous) one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried adding the "dimstyle command to the bottom, but since the first dim-command doesn't end after placing one dimension. It's kinda stuck in that action. And If I press escape, it exits the lisp without ever getting to the next resetting of the dimstyle. Any insight on how this can be solved?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 13:28:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8361786#M97737</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-26T13:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8361864#M97738</link>
      <description>&lt;P&gt;It could be solved surprisingly easy... add "-s" suffix. COMMAND-S keeps the user inside the command until he decides to quit.&lt;/P&gt;
&lt;P&gt;Also added the *error* function which returns all the changed variables in case of error or ESC hit or so.&lt;/P&gt;
&lt;PRE&gt;(defun c:RectangleFilled ( / *error* ocl ost)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg)))
      (setvar 'CECOLOR ocl)
      (command-s "_.DIMSTYLE" "_Re" ost)
    (princ))
  
  (setq ocl (getvar 'CECOLOR))
  (setq ost (getvar 'DIMSTYLE))
  
  (setvar 'CECOLOR "7")
  (command "_.RECTANG" pause "_Rotation" "_Pick" "@" (getpoint (getvar 'LASTPOINT)) pause)
  (setvar 'CECOLOR "1")
  (command "_.BHATCH" "_P" "_Solid" "_S" "_L" "" "")
  (command "_.DIMSTYLE" "_Re" "ISO-25")
  (setvar 'CECOLOR ocl)
&lt;FONT color="#0000FF"&gt;  (initcommandversion)
  (command-s "_.DIM")&lt;/FONT&gt;
  (command "_.DIMSTYLE" "_Re" ost)
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;The blue part can be alternated with this line, to follow Kent's suggestion. This way you can save one more click.&lt;/P&gt;
&lt;PRE&gt;(command "_.DIMALIGNED" &lt;STRONG&gt;""&lt;/STRONG&gt; &lt;STRONG&gt;PAUSE&lt;/STRONG&gt; PAUSE)  ; select an edge, then place the &lt;/PRE&gt;
&lt;P&gt;BTW It's not about how many dims you need to add, but how many user inputs you need to do. Single PAUSE for each. So in this case it depends how you're use to make a DIM - whether you select &amp;lt;object&amp;gt; then an EDGE then place the DIM, or pick a left end, then right end, then place the DIM - that's something for you to thing about and place the correct &lt;STRONG&gt;""&lt;/STRONG&gt; for &amp;lt;enter&amp;gt; or &lt;STRONG&gt;PAUSE&lt;/STRONG&gt; to the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:01:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8361864#M97738</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-10-26T14:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8367813#M97739</link>
      <description>&lt;P&gt;Works like a charm!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the&amp;nbsp; defun: "C" has to be a capital letter tough?&lt;/P&gt;&lt;P&gt;It didn't work untill I changed that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But thanks again for all your time and effort! A true Lisp-wizard&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 08:26:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8367813#M97739</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-30T08:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8367857#M97740</link>
      <description>&lt;P&gt;Glad to help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
... I think the&amp;nbsp; defun: "C" has to be a capital letter tough?...&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not really.&lt;/P&gt;
&lt;P&gt;Try this c:Test and see...&lt;/P&gt;
&lt;PRE&gt;(defun c:Test () (princ "That was with 'c'!") (princ))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 08:51:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/8367857#M97740</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-10-30T08:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9896594#M97741</link>
      <description>&lt;P&gt;Hi all, after working with the command for some time (thanks again!)&lt;/P&gt;&lt;P&gt;I've still noticed a few issues I was wondering could be fixed... ?&lt;/P&gt;&lt;P&gt;In a nutshell, some settings before I've used the command should be unchanged after the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The hatch color should always be red (0% transparency).&lt;BR /&gt;Afterwards hatchcolor should return to the previous setting or bylayer.&lt;/P&gt;&lt;P&gt;- The rotation should afterward return to 0degrees (now, when I use the command for a rotated rectangle the degrees are stored. When I then draw a regular rectangle it always takes the previous inclanation and is never 0degreees.&lt;/P&gt;&lt;P&gt;- The dimstyle should also return to the previous dimstyle. Instead it defaults to the one in the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'ld be happy to try some things out if anyone could give me hint as where to look...&lt;BR /&gt;I've tried to put&amp;nbsp; -s in front of the commands but doesn't seem to help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 08:15:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9896594#M97741</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-26T08:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9896772#M97742</link>
      <description>&lt;P&gt;I wonder what you are actually doing because the code posted #13 (possibly with DIMALIGN included) should always restore the color and dimstyle.&lt;/P&gt;
&lt;P&gt;Though, not a rectang rotation, that's another story and not that simple (you need to re-run the command, set rotation to 0, and force the command to end:&amp;nbsp;(command "_.rectang" '(0 0) "_R" 0) (command). And on top of that, this won't work in the *error*.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:RectangleFilled ( / *error* ocl ost)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg)))
      &lt;FONT color="#FF0000"&gt;(setvar 'CECOLOR ocl) ; restore in case of error (inc. ESC)&lt;/FONT&gt;
      &lt;FONT color="#0000FF"&gt;(command-s "_.DIMSTYLE" "_Re" ost)&lt;/FONT&gt;
    (princ))
  
  &lt;FONT color="#FF0000"&gt;(setq ocl (getvar 'CECOLOR)) ; save old value&lt;/FONT&gt;
  &lt;FONT color="#0000FF"&gt;(setq ost (getvar 'DIMSTYLE))&lt;/FONT&gt;
  
  &lt;FONT color="#FF0000"&gt;(setvar 'CECOLOR "7") ; change&lt;/FONT&gt; 
  (command "_.RECTANG" pause "_Rotation" "_Pick" "@" (getpoint (getvar 'LASTPOINT)) pause)
  &lt;FONT color="#FF0000"&gt;(setvar 'CECOLOR "1") ; change again&lt;/FONT&gt;
  (command "_.BHATCH" "_P" "_Solid" "_S" "_L" "" "")
  &lt;FONT color="#0000FF"&gt;(command "_.DIMSTYLE" "_Re" "ISO-25")&lt;/FONT&gt;
  &lt;FONT color="#FF0000"&gt;(setvar 'CECOLOR ocl) ; restore&lt;/FONT&gt;
  (initcommandversion)
  (command-s "_.DIM")
  &lt;FONT color="#0000FF"&gt;(command "_.DIMSTYLE" "_Re" ost)&lt;/FONT&gt;
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 09:53:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9896772#M97742</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-11-26T09:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9904035#M97743</link>
      <description>&lt;P&gt;Hi. thanks so much for replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried the last code... I might restore the hatch afterwards, but the hatchcolor of the created item isnt always red. It takes the last hatchcolor+transparancy that was used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance... when I manually hatch an object in pink. Then start the lisp,, the hatch used for the lisp-rectangle will also be pink...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way around this? Ive tried experimenting with several tiny modifications but nothing seems to work.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 13:00:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9904035#M97743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T13:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp or command for square with red hatch</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9904364#M97744</link>
      <description>&lt;P&gt;Here is your help:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Z9E3zK5E_0-1606746319948.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/850229i5CDB04EF4E451650/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Z9E3zK5E_0-1606746319948.png" alt="Z9E3zK5E_0-1606746319948.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the code updated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:RectangleFilled ( / *error* oCECOLOR oHPCOLOR oHPTRANSPARENCY oDIMSTYLE)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg)))
    (if oCECOLOR (setvar 'CECOLOR oCECOLOR))    
    (if oHPCOLOR (setvar 'HPCOLOR oHPCOLOR))
    (if oHPTRANSPARENCY (setvar 'HPTRANSPARENCY oHPTRANSPARENCY))
    (command-s "_.DIMSTYLE" "_Re" oDIMSTYLE)
    (princ))
  
  (setq oCECOLOR (getvar 'CECOLOR))
  (setq oHPCOLOR (getvar 'HPCOLOR))
  (setq oHPTRANSPARENCY (getvar 'HPTRANSPARENCY))
  (setq oDIMSTYLE (getvar 'DIMSTYLE))
  
  (setvar 'CECOLOR "7")
  (command "_.RECTANG" pause "_Rotation" "_Pick" "@" (getpoint (getvar 'LASTPOINT)) pause)
  (command "_.RECTANG" '(0 0) "_R" 0.) (command)
  (setvar 'HPCOLOR "1")
  (setvar 'HPTRANSPARENCY "0")
  (command "_.BHATCH" "_P" "_Solid" "_S" "_L" "" "")
  (command "_.DIMSTYLE" "_Re" "ISO-25")
  (setvar 'CECOLOR oCECOLOR)
  (command "_.DIMALIGNED" "" pause)
  (if (&amp;gt; (getvar 'cmdactive) 0) (command pause))
  (command "_.DIMSTYLE" "_Re" ost)
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: If you don't want to add a dim to it, right-click will cancel the dimalign.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 14:48:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-command-for-square-with-red-hatch/m-p/9904364#M97744</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-11-30T14:48:33Z</dc:date>
    </item>
  </channel>
</rss>

