<?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 Routine Request in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319765#M22839</link>
    <description>&lt;P&gt;Frankly, I think you should make a custom toolbar button for such a thing, but here goes...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:YELLOW ()&lt;BR /&gt;(command "-insert" "STAR")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should do it.&amp;nbsp; It assumes the block "STAR" is either found on a search path, or already defined in your drawing.&amp;nbsp; It stops at the point of where do you want to insert, scale, and rotate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one asks for the insertion point up-front, then inserts the block at full scale.&lt;/P&gt;&lt;P&gt;(defun C:YELLOW ()&lt;/P&gt;&lt;P&gt;&amp;nbsp;(promt "Select an insertion point:")&lt;/P&gt;&lt;P&gt;&amp;nbsp;(setq USERPOINT (getpoint))&lt;BR /&gt;&amp;nbsp;(command "-insert" "STAR" USERPOINT "1")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on your ACAD configuration, you may need to supply X and Y scale...&lt;/P&gt;&lt;P&gt;&amp;nbsp;(command "-insert" "STAR" USERPOINT "1" "1")&lt;/P&gt;&lt;P&gt;and rotation...&lt;/P&gt;&lt;P&gt;(command "-insert" "STAR" USERPOINT "1" "1" "0")&lt;/P&gt;&lt;P&gt;... so one of these lines might work for you.&amp;nbsp; There are ways to detect the environment settings and use an IF or COND statement to decide which command sequence to use.&amp;nbsp; Also note the "1" "1" "0" can probably be written 1 1 0, and using the "command" function, I know the quoted numbers will work for sure.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2023 14:31:02 GMT</pubDate>
    <dc:creator>james_moore</dc:creator>
    <dc:date>2023-10-20T14:31:02Z</dc:date>
    <item>
      <title>LISP Routine Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319720#M22838</link>
      <description>&lt;P&gt;Sup,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obligatory "I'm new to LISP's".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want the LISP routine to do:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I type in the command: YELLOW&lt;/LI&gt;&lt;LI&gt;A pre-loaded block named STAR is inserted as if you've ran the -INSERT command and selected the STAR block manually&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Basically a custom command to insert a specific block. Not sure if this is possible or not.&lt;/P&gt;&lt;P&gt;Thanks for the help and knowledge!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 14:14:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319720#M22838</guid>
      <dc:creator>Jackson_Hollis_TESSERE</dc:creator>
      <dc:date>2023-10-20T14:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: LISP Routine Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319765#M22839</link>
      <description>&lt;P&gt;Frankly, I think you should make a custom toolbar button for such a thing, but here goes...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:YELLOW ()&lt;BR /&gt;(command "-insert" "STAR")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should do it.&amp;nbsp; It assumes the block "STAR" is either found on a search path, or already defined in your drawing.&amp;nbsp; It stops at the point of where do you want to insert, scale, and rotate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one asks for the insertion point up-front, then inserts the block at full scale.&lt;/P&gt;&lt;P&gt;(defun C:YELLOW ()&lt;/P&gt;&lt;P&gt;&amp;nbsp;(promt "Select an insertion point:")&lt;/P&gt;&lt;P&gt;&amp;nbsp;(setq USERPOINT (getpoint))&lt;BR /&gt;&amp;nbsp;(command "-insert" "STAR" USERPOINT "1")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on your ACAD configuration, you may need to supply X and Y scale...&lt;/P&gt;&lt;P&gt;&amp;nbsp;(command "-insert" "STAR" USERPOINT "1" "1")&lt;/P&gt;&lt;P&gt;and rotation...&lt;/P&gt;&lt;P&gt;(command "-insert" "STAR" USERPOINT "1" "1" "0")&lt;/P&gt;&lt;P&gt;... so one of these lines might work for you.&amp;nbsp; There are ways to detect the environment settings and use an IF or COND statement to decide which command sequence to use.&amp;nbsp; Also note the "1" "1" "0" can probably be written 1 1 0, and using the "command" function, I know the quoted numbers will work for sure.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 14:31:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319765#M22839</guid>
      <dc:creator>james_moore</dc:creator>
      <dc:date>2023-10-20T14:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: LISP Routine Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319978#M22840</link>
      <description>The first routine you wrote works perfectly. TYSM!</description>
      <pubDate>Fri, 20 Oct 2023 15:47:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12319978#M22840</guid>
      <dc:creator>Jackson_Hollis_TESSERE</dc:creator>
      <dc:date>2023-10-20T15:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: LISP Routine Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12322265#M22841</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"Frankly, I think you should make a custom toolbar button for such a thing,"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I agree easy to make.&lt;/SPAN&gt;&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="SeaHaven_0-1697952272602.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1282145iE343B38C85337C03/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_0-1697952272602.png" alt="SeaHaven_0-1697952272602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Others here will talk about Toolpallete's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2023 05:26:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-request/m-p/12322265#M22841</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-10-22T05:26:24Z</dc:date>
    </item>
  </channel>
</rss>

