<?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 for insert block from another drawing in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7144540#M119162</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;PRE&gt;^C^C_insert;"Template";^C-insert;"*Block 1";0,0;;;&lt;/PRE&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;Please help to convert this macro script into a lisp that does exactly the same thing.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This should do it [untested]:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:&lt;STRONG&gt;IB1&lt;/STRONG&gt; (); =&lt;STRONG&gt; I&lt;/STRONG&gt;nsert &lt;STRONG&gt;B&lt;/STRONG&gt;lock &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (command "_.insert" "Template") (command)&lt;/P&gt;&lt;P&gt;&amp;nbsp; (command "_.insert" "*Block 1" "0,0" "" "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; (princ)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The (command) function with no arguments is to cancel the first Insert command after the definition has been brought in [read about it in Help for (command)].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change the &lt;STRONG&gt;IB1&lt;/STRONG&gt; to whatever you prefer as a command name.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thanks man. It works!&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 00:35:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-12T00:35:22Z</dc:date>
    <item>
      <title>lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7143684#M119160</link>
      <description>&lt;PRE&gt;^C^C_insert;"Template";^C-insert;"*Block 1";0,0;;;&lt;/PRE&gt;&lt;P&gt;I use the above macro script to insert 'Block 1' from Template.dwg into current drawing at 0,0,0 &amp;amp; explode it. I have the folder location in my search path.&lt;/P&gt;&lt;P&gt;Please help to convert this macro script into a lisp that does exactly the same thing.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2017 00:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7143684#M119160</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-11T00:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7144075#M119161</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;PRE&gt;^C^C_insert;"Template";^C-insert;"*Block 1";0,0;;;&lt;/PRE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;Please help to convert this macro script into a lisp that does exactly the same thing.&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This should do it [untested]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:&lt;STRONG&gt;IB1&lt;/STRONG&gt; (); =&lt;STRONG&gt; I&lt;/STRONG&gt;nsert &lt;STRONG&gt;B&lt;/STRONG&gt;lock &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (command "_.insert" "Template") (command)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (command "_.insert" "*Block 1" "0,0" "" "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (princ)&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The (command) function with no arguments is to cancel the first Insert command after the definition has been brought in [read about it in Help for (command)].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change the &lt;STRONG&gt;IB1&lt;/STRONG&gt; to whatever you prefer as a command name.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2017 11:49:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7144075#M119161</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-06-11T11:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7144540#M119162</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;PRE&gt;^C^C_insert;"Template";^C-insert;"*Block 1";0,0;;;&lt;/PRE&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;Please help to convert this macro script into a lisp that does exactly the same thing.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This should do it [untested]:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:&lt;STRONG&gt;IB1&lt;/STRONG&gt; (); =&lt;STRONG&gt; I&lt;/STRONG&gt;nsert &lt;STRONG&gt;B&lt;/STRONG&gt;lock &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (command "_.insert" "Template") (command)&lt;/P&gt;&lt;P&gt;&amp;nbsp; (command "_.insert" "*Block 1" "0,0" "" "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; (princ)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The (command) function with no arguments is to cancel the first Insert command after the definition has been brought in [read about it in Help for (command)].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change the &lt;STRONG&gt;IB1&lt;/STRONG&gt; to whatever you prefer as a command name.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thanks man. It works!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 00:35:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/7144540#M119162</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-12T00:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11820898#M119163</link>
      <description>&lt;P&gt;Thank you it works !&lt;/P&gt;&lt;P&gt;However, is it possible to modify the script in order to get the X and Y coordinates from the user's input and not to have them predefined ? In addition to that, can we fix the Z coordinate to a fixed value ?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 16:38:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11820898#M119163</guid>
      <dc:creator>m.jouini</dc:creator>
      <dc:date>2023-03-14T16:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11821773#M119164</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8702158"&gt;@m.jouini&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;.... is it possible to modify the script in order to get the X and Y coordinates from the user's input and not to have them predefined ? In addition to that, can we fix the Z coordinate to a fixed value ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can change the Insert line:&lt;/P&gt;
&lt;P&gt;(command "_.insert" "*Block 1" &lt;FONT color="#FF0000"&gt;pause&lt;/FONT&gt; "" "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you always want the Z to be the same, but the User's input at the pause might involve some different Z value, try:&lt;/P&gt;
&lt;P&gt;(command "_.insert" "*Block 1" &lt;FONT color="#FF0000"&gt;".XY" pause &lt;FONT color="#00CCFF"&gt;&lt;EM&gt;YourZvalue&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt; "" "")&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 00:11:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11821773#M119164</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-15T00:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11821795#M119165</link>
      <description>&lt;P&gt;Another option maybe worth looking at is Lee-mac Steal.lsp can be program driven known block name, no user input, also does much more including multiple blocks in one go.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 00:26:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11821795#M119165</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-03-15T00:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822451#M119166</link>
      <description>&lt;P&gt;Thank you very much for your fast response !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;You can change the Insert line:&lt;/P&gt;&lt;P&gt;(command "_.insert" "*Block 1" &lt;FONT color="#FF0000"&gt;pause&lt;/FONT&gt; "" "")&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;this one worked very well as intended!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;If you always want the Z to be the same, but the User's input at the pause might involve some different Z value, try:&lt;/P&gt;&lt;P&gt;(command "_.insert" "*Block 1" &lt;FONT color="#FF0000"&gt;".XY" pause &lt;FONT color="#00CCFF"&gt;&lt;EM&gt;YourZvalue&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt; "" "")&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;however, maybe I missed something here but when I try this script it doesn't work for me as it's supposed to.&lt;/P&gt;&lt;P&gt;this is the script in my example :&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;  (command "_.insert" "Picto Asc" ".XY" pause 3 "" "")&lt;/LI-CODE&gt;&lt;P&gt;I want the bloc to be always placed at a height of 3 (Z value=3)&lt;/P&gt;&lt;P&gt;here's how it works after I execute it :&lt;/P&gt;&lt;P&gt;1) it tells me to specify an insertion point :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjouini_0-1678871512074.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1188871i3E95564A94FF2A1F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjouini_0-1678871512074.png" alt="mjouini_0-1678871512074.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) After I select an insertion point, it's supposed to be placed automatically in it with a value of Z=3. But a &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;(need Z)&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;appears in the dialogue box :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjouini_2-1678871979522.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1188874i962A32F6B091BD75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjouini_2-1678871979522.png" alt="mjouini_2-1678871979522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) if I click, the bloc is infact inserted in the insertion point I've chosen but with Z=0 and scaled by 3 in X,Y and Z axis.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjouini_3-1678872167913.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1188884iDC8111173DCB0FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjouini_3-1678872167913.png" alt="mjouini_3-1678872167913.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What did I miss ?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 09:23:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822451#M119166</guid>
      <dc:creator>m.jouini</dc:creator>
      <dc:date>2023-03-15T09:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822733#M119167</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8702158"&gt;@m.jouini&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;.... when I try this script it doesn't work for me as it's supposed to....&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;What did I miss ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You didn't -- I did.&amp;nbsp; I confess I hadn't actually &lt;EM&gt;tried&lt;/EM&gt; it, relying on it to work the same way in an AutoLisp (command) function as it does manually at the Command: line.&amp;nbsp; I don't know why it doesn't, but this variant approach seems to work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;(command "_.insert" "Picto Asc" ".z" "0,0,3" pause "" "")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 11:39:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822733#M119167</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-15T11:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822757#M119168</link>
      <description>&lt;P&gt;Thank you, it worked !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 11:46:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822757#M119168</guid>
      <dc:creator>m.jouini</dc:creator>
      <dc:date>2023-03-15T11:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: lisp for insert block from another drawing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822930#M119169</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;A href="https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-B5D64510-561E-4FA9-8AD6-625445CCD81F" target="_blank" rel="noopener"&gt;-INSERTCONTENT&lt;/A&gt; command was added with the 2021 version of AutoCAD which finally allows you to insert a block directly from another drawing. This macro starts the command and&amp;nbsp;&lt;SPAN&gt;display the Select Drawing File dialog box for the drawing with the block you want to insert:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;^C^C-INSERTCONTENT ~;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To account for spaces in file names and paths you need to use a semicolon for enter in these macros. The&amp;nbsp;&lt;SPAN&gt;tilde (&lt;/SPAN&gt;&lt;STRONG&gt;~&lt;/STRONG&gt;&lt;SPAN&gt;) was to display the Select Drawing File dialog box in the macro above, do not include it with macros that include filenames.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This macro example inserts the block "Construction Entrance" from drawing G:/ENGDESGN/BeaufordT/Blocks/Typicals/Typicals.dwg&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;^C^C-INSERTCONTENT G:/ENGDESGN/BeaufordT/Blocks/Typicals/Typicals.dwg;Construction Entrance;&lt;/LI-CODE&gt;&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 13:09:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-insert-block-from-another-drawing/m-p/11822930#M119169</guid>
      <dc:creator>TomBeauford</dc:creator>
      <dc:date>2023-03-15T13:09:51Z</dc:date>
    </item>
  </channel>
</rss>

