<?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: Need help with a basic script to insert a block from a resource file in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188455#M5560</link>
    <description>&lt;P&gt;FYI, you may be interested in reading one of my recent articles I wrote on the topic of using &lt;STRONG&gt;Script&lt;/STRONG&gt; files in &lt;STRONG&gt;AutoCAD&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;A href="https://issuu.com/augi/docs/aw202205hr/18?ff" target="_blank"&gt;AUGIWORLD by AUGI, Inc. - Issuu&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 04:55:45 GMT</pubDate>
    <dc:creator>paullimapa</dc:creator>
    <dc:date>2024-12-03T04:55:45Z</dc:date>
    <item>
      <title>Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188200#M5552</link>
      <description>&lt;P&gt;Hello to all:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use scripting to insert blocks from a resource file into a dwg.&amp;nbsp; My starting code is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;^C^C_insert;"ResourceFile";^C-insert;"*Block_1";0,0;;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script runs, but nothing happens...then I press ENTER and get the "unknown ccommand message.&amp;nbsp; I'm attaching a pic that shows all my source info.&amp;nbsp; Do i have the support path wrong?..., that's the only thing I can think of.&amp;nbsp; Thanks for any help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 01:19:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188200#M5552</guid>
      <dc:creator>acadadmin3KNUF</dc:creator>
      <dc:date>2024-12-03T01:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188331#M5553</link>
      <description>&lt;P&gt;Try it without the quotation marks.&amp;nbsp; They're not needed in a command macro.&amp;nbsp; And you may need an additional semicolon at the end [your first completes the insertion point, second and third for X and Y scale factors, but nothing for rotation], unless the Block is defined for uniform scaling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume the unknown command message tells you &lt;EM&gt;what the unknown command was&lt;/EM&gt; -- fill us in.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 03:02:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188331#M5553</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-12-03T03:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188345#M5554</link>
      <description>&lt;P&gt;Here is exactly what the command line gives in return.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output.JPG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1441180i86BB91B17F57E0F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="output.JPG" alt="output.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 03:16:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188345#M5554</guid>
      <dc:creator>acadadmin3KNUF</dc:creator>
      <dc:date>2024-12-03T03:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188360#M5555</link>
      <description>&lt;P&gt;First of all it looks like you are in the drawing called ResourceFile.dwg and you're trying to insert a drawing that has the same name which AutoCAD won't let you do.&lt;/P&gt;&lt;P&gt;Second the sequence of commands you show in Notepad is NOT a script file but a macro that will only run when placed inside a menu button.&lt;/P&gt;&lt;P&gt;A script file containing this sequence of commands would look something like this (note the extra return after last line):&lt;/P&gt;&lt;LI-CODE lang="general"&gt;_.-insert ResourceFile _SC 1 0,0 0
_.Erase L

_.-insert *Block_1 0,0 1 0
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Dec 2024 03:34:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188360#M5555</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-03T03:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188391#M5556</link>
      <description>&lt;P&gt;Uisng a lisp you can check does block_1 exist in this dwg, if not then go insert Resourcefile.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(if (=  (tblsearch "BLOCK" "block_1") nil)
(command "-insert" ResourceFile "_SC" 1 0,0 0)
)
(Command "-insert" "Block_1" 0,0 1 1 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 04:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188391#M5556</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-12-03T04:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188416#M5557</link>
      <description>&lt;P&gt;Yeah I discovered that thing about the macro having to be inside a command on a menu button; i found that out after I posted the question and couldn't delete it.&amp;nbsp; I couldnt get your script text to work though.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 04:33:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188416#M5557</guid>
      <dc:creator>acadadmin3KNUF</dc:creator>
      <dc:date>2024-12-03T04:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188418#M5558</link>
      <description>&lt;P&gt;Thanks to all that replied; I'm going to get some help from my ACAD provider tomorrow.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 04:34:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188418#M5558</guid>
      <dc:creator>acadadmin3KNUF</dc:creator>
      <dc:date>2024-12-03T04:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188452#M5559</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Script&lt;/STRONG&gt; files run by entering at &lt;STRONG&gt;AutoCAD's&lt;/STRONG&gt; command prompt:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SCRIPT&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The&lt;STRONG&gt; Select Script File&lt;/STRONG&gt; window appears showing you all files with extension .&lt;STRONG&gt;SCR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Select the &lt;STRONG&gt;Script&lt;/STRONG&gt; file you want to run.&lt;/P&gt;&lt;P&gt;In this case I named the script file &lt;STRONG&gt;ResourceFile.scr&lt;/STRONG&gt; then click the &lt;STRONG&gt;Open&lt;/STRONG&gt; button&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_0-1733200869528.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1441192i9994BA82C374D8F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_0-1733200869528.png" alt="paullimapa_0-1733200869528.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note the drawing file is named &lt;STRONG&gt;Drawing1.dwg&lt;/STRONG&gt; and does not match with the name of the &lt;STRONG&gt;Block&lt;/STRONG&gt; you want to insert&amp;nbsp;&lt;STRONG&gt;ResourceFile.dwg&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AutoCAD&lt;/STRONG&gt; will then run the commands as you entered them in the &lt;STRONG&gt;Script&lt;/STRONG&gt; file:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_1-1733200976649.png" style="width: 685px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1441195iBD7E9DAB6F7C36FE/image-dimensions/685x186?v=v2" width="685" height="186" role="button" title="paullimapa_1-1733200976649.png" alt="paullimapa_1-1733200976649.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this case I changed the &lt;STRONG&gt;Script&lt;/STRONG&gt; file from my last post to look like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun script-cancel ()(command)(command "resume"))
_.-insert ResourceFile 0,0
(script-cancel)
_.-insert *Block_1 0,0 1 0&lt;/LI-CODE&gt;&lt;P&gt;The &lt;STRONG&gt;Script&lt;/STRONG&gt; first defines a lisp function called&amp;nbsp;&lt;STRONG&gt;script-cancel&lt;/STRONG&gt; that would &lt;STRONG&gt;cancel&lt;/STRONG&gt; the current active command and continue to &lt;STRONG&gt;resume&lt;/STRONG&gt; with the next commands in the &lt;STRONG&gt;Script&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Then the &lt;STRONG&gt;Script&lt;/STRONG&gt; executes the &lt;STRONG&gt;Insert&lt;/STRONG&gt; command as you showed in your menu macro.&lt;/P&gt;&lt;P&gt;After entering the insertion point of &lt;STRONG&gt;0,0&lt;/STRONG&gt;&amp;nbsp;the &lt;STRONG&gt;Script&lt;/STRONG&gt; runs the &lt;STRONG&gt;(script-cancel)&lt;/STRONG&gt; function to &lt;STRONG&gt;cancel&lt;/STRONG&gt; the remainder of the &lt;STRONG&gt;Insert&lt;/STRONG&gt; prompts and continues to &lt;STRONG&gt;Resume&lt;/STRONG&gt; to the next &lt;STRONG&gt;Insert&lt;/STRONG&gt; command sequence in the &lt;STRONG&gt;Script&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Since the forum does not support the attachment of &lt;STRONG&gt;Script&lt;/STRONG&gt; files, I've attached the entire &lt;STRONG&gt;Script&lt;/STRONG&gt; file using extension &lt;STRONG&gt;.txt&lt;/STRONG&gt;. When you save the attachment just rename the file as&amp;nbsp;&lt;STRONG&gt;ResourceFile.scr&lt;/STRONG&gt;. Then &lt;STRONG&gt;AutoCAD's Script&lt;/STRONG&gt; command will see this in the &lt;STRONG&gt;Select Script&lt;/STRONG&gt; &lt;STRONG&gt;File&lt;/STRONG&gt; window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 04:52:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188452#M5559</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-03T04:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188455#M5560</link>
      <description>&lt;P&gt;FYI, you may be interested in reading one of my recent articles I wrote on the topic of using &lt;STRONG&gt;Script&lt;/STRONG&gt; files in &lt;STRONG&gt;AutoCAD&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;A href="https://issuu.com/augi/docs/aw202205hr/18?ff" target="_blank"&gt;AUGIWORLD by AUGI, Inc. - Issuu&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 04:55:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188455#M5560</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-03T04:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188462#M5561</link>
      <description>&lt;P&gt;-insert&lt;BR /&gt;C:/Users/matthew.neesley/Desktop/ACAD_Insert_Test/ResourceFile.dwg&lt;BR /&gt;0,0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;BR /&gt;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above text got me what I needed.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 05:05:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188462#M5561</guid>
      <dc:creator>acadadmin3KNUF</dc:creator>
      <dc:date>2024-12-03T05:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188469#M5562</link>
      <description>&lt;P&gt;Your macro that you posted also includes insert *block_1&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 05:07:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188469#M5562</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-03T05:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188480#M5563</link>
      <description>&lt;P&gt;Ok.&amp;nbsp; I'm really gonna throw you ALL for a loop.&amp;nbsp; Here's what I REALLY NEEDED, ALL of it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-insert&lt;BR /&gt;C:/Users/matthew.neesley/Desktop/ACAD_Insert_Test/ResourceFile.dwg&lt;BR /&gt;0,0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;BR /&gt;0&lt;BR /&gt;erase&lt;BR /&gt;L&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;insert&lt;BR /&gt;Block_1&lt;BR /&gt;0,0&lt;BR /&gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;purge&lt;BR /&gt;b&lt;BR /&gt;ResourceFile&lt;BR /&gt;y&lt;BR /&gt;y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 05:43:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13188480#M5563</guid>
      <dc:creator>acadadmin3KNUF</dc:creator>
      <dc:date>2024-12-03T05:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a basic script to insert a block from a resource file</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13190473#M5564</link>
      <description>&lt;P&gt;As suggested on other posts same task using Lee-mac Steal.lsp will do what you want just pulling the one block from another dwg. It only requires like 2-3 lines of code, you just load Lee's Steal then run the call for the required block.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(if (not stealall )(load "StealV1-8.lsp"))
(Steal "C:\\My Folder\\MyDrawing.dwg" 
   '(("Blocks" ("Block_1")))
)       &lt;/LI-CODE&gt;&lt;P&gt;I will leave it to you to download the latest version of steal.lsp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 22:28:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-a-basic-script-to-insert-a-block-from-a-resource/m-p/13190473#M5564</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-12-03T22:28:18Z</dc:date>
    </item>
  </channel>
</rss>

