<?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: Exploding Blocks on Insert in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058066#M134176</link>
    <description>&lt;P&gt;Actually the 'find' function is a homebrew..... because I deal with AutoCAD Electrical, I needed a way to not only search the AutoCAD paths (which you'd normally do with findfile) but also the AutoCAD Electrical project paths hence the custom 'all-in-one' function!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a typo however, albeit probabily insignificant (as it is only a comment) which is the returned path is actually&lt;/P&gt;&lt;PRE&gt;;returns "c://drawing.dwg"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this aside.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Originally this was a AutoCAD menu customisation and contained&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;^C^C^P(setvar"ATTREQ" 0) (command "_.INSERT" "*drawing" pause 1.0 0.0)(setvar "ATTREQ" 1)&lt;/PRE&gt;&lt;P&gt;Note, the '*' asterisk which DID explode on insertion.&amp;nbsp; All I tried to do was to convert this in to a .lsp file which is on the server for all to use when importing an AutoCAD Electrical project.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2016 13:10:02 GMT</pubDate>
    <dc:creator>dbrblg</dc:creator>
    <dc:date>2016-02-26T13:10:02Z</dc:date>
    <item>
      <title>Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6057810#M134174</link>
      <description>&lt;P&gt;Lisp again &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a lisp function which I use to insert blocks:&lt;/P&gt;&lt;PRE&gt;(defun c:TestFunction ()
	(setq FF1 (Find "drawing.dwg"))
        ;returns "c:\drawing.dwg"
	(if FF1
	  (PROGN
		(setvar"ATTREQ" 0)
		(command "_.INSERT" (strcat "*" FF1) pause 1.0 1.0 0.0)
		(setvar"ATTREQ" 1)
	  )
	)
	(princ)
)&lt;/PRE&gt;&lt;P&gt;What I want is to explode on insert.&amp;nbsp; For this, I believe you need an '*' before the file name.&amp;nbsp; The prblem I'm having is where to put this '*' as all I get is various errors (depending on where I place it) ranging from nil and too many arguments to just doing nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I have tried (without success) &lt;img id="smileymad" class="emoticon emoticon-smileymad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-mad.png" alt="Smiley Mad" title="Smiley Mad" /&gt;&lt;/P&gt;&lt;PRE&gt;(setq FF1 (Find *"drawing.dwg"))
and
(setq FF1 (Find "*drawing.dwg"))&lt;/PRE&gt;&lt;P&gt;also&lt;/P&gt;&lt;PRE&gt;(command "_.INSERT" (strcat "*" FF1) pause 1.0 1.0 0.0)
and
(command "_.INSERT"  *FF1 pause 1.0 1.0 0.0)&lt;/PRE&gt;&lt;P&gt;can anyone tell me the correct way to do correct this please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 09:28:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6057810#M134174</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2016-02-26T09:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058055#M134175</link>
      <description>&lt;P&gt;The correct function is findfile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq dwg (findfile "yourfile.dwg"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to adjust the attreq variables because there won't be any attribute requests when the drawing is inserted and exploded at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your actual insert command seems fine. &amp;nbsp;The asterisk is where it should be in the strcat function.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 13:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058055#M134175</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-02-26T13:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058066#M134176</link>
      <description>&lt;P&gt;Actually the 'find' function is a homebrew..... because I deal with AutoCAD Electrical, I needed a way to not only search the AutoCAD paths (which you'd normally do with findfile) but also the AutoCAD Electrical project paths hence the custom 'all-in-one' function!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a typo however, albeit probabily insignificant (as it is only a comment) which is the returned path is actually&lt;/P&gt;&lt;PRE&gt;;returns "c://drawing.dwg"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this aside.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Originally this was a AutoCAD menu customisation and contained&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;^C^C^P(setvar"ATTREQ" 0) (command "_.INSERT" "*drawing" pause 1.0 0.0)(setvar "ATTREQ" 1)&lt;/PRE&gt;&lt;P&gt;Note, the '*' asterisk which DID explode on insertion.&amp;nbsp; All I tried to do was to convert this in to a .lsp file which is on the server for all to use when importing an AutoCAD Electrical project.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 13:10:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058066#M134176</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2016-02-26T13:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058122#M134177</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/436992"&gt;@dbrblg&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Actually the 'find' function is a homebrew..... because I deal with AutoCAD Electrical, I needed a way to not only search the AutoCAD paths (which you'd normally do with findfile) but also the AutoCAD Electrical project paths hence the custom 'all-in-one' function!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a typo however, albeit probabily insignificant (as it is only a comment) which is the returned path is actually&lt;/P&gt;
&lt;PRE&gt;;returns "c://drawing.dwg"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this aside.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Originally this was a AutoCAD menu customisation and contained&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;^C^C^P(setvar"ATTREQ" 0) (command "_.INSERT" "*drawing" pause 1.0 0.0)(setvar "ATTREQ" 1)&lt;/PRE&gt;
&lt;P&gt;Note, the '*' asterisk which DID explode on insertion.&amp;nbsp; All I tried to do was to convert this in to a .lsp file which is on the server for all to use when importing an AutoCAD Electrical project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm little bit lost in your post, but&amp;nbsp;this works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "_.INSERT" "*c:/Users/User/Desktop/_download/drawing1.dwg" pause 1.0 "" 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and this as well:&lt;/P&gt;
&lt;P&gt;(command "_.INSERT" (strcat "*" (findfile "drawing1.dwg")) pause 1.0 0.0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that there is one &lt;STRONG&gt;/&lt;/STRONG&gt; (or two &lt;STRONG&gt;\\&lt;/STRONG&gt;) in the path. Two of&lt;STRONG&gt; //&lt;/STRONG&gt; is not correct.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 13:43:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058122#M134177</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-02-26T13:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058626#M134178</link>
      <description>&lt;P&gt;I agree with&amp;nbsp; &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your command:&lt;/P&gt;
&lt;PRE&gt;(command "_.INSERT" (strcat "*" FF1) pause 1.0 1.0 0.0)&lt;/PRE&gt;
&lt;P&gt;should be fine assuming Find is doing its work. Nesting that command statement in the if statement is good but if Find is not returning a correct string, then just checking if FF1 is not nil (which is what you are doing) may not be enough.&amp;nbsp; Your error is most likely in your homebrew Find command.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 17:30:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6058626#M134178</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-02-26T17:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6061098#M134179</link>
      <description>&lt;P&gt;Now, it does something different &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I have&lt;/P&gt;&lt;PRE&gt;(command "_.INSERT" FF1 pause 1.0 1.0 0.0)&lt;/PRE&gt;&lt;P&gt;and I run the function, I am prompted where to put the block and as I move the mouse around the block is visible at the cursor.&amp;nbsp; The only thing is that when I click, the block is placed where I select but is not exploded - as you would expect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I change this to&lt;/P&gt;&lt;PRE&gt;(command "_.INSERT" (strcat "*" FF1) pause 1.0 1.0 0.0)&lt;/PRE&gt;&lt;P&gt;There are two noticable differences. The first is that when I move the mouse to the point I want to place the block, it is not visible at the cursor so I cannot see the block outline.&amp;nbsp; The second thing is that when I click where to place the block, it is inserted and it does explode but for some reason it is at an angle &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;&lt;P&gt;The only difference is strcat and an asterisk, no where do I tell it not to give me a preview at the cursor (don't know how to do this) and no where do I tell it to rotate the block at an angle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What on earth is going on?&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>Mon, 29 Feb 2016 09:30:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6061098#M134179</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2016-02-29T09:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Exploding Blocks on Insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6061767#M134180</link>
      <description>&lt;P&gt;That's the nature of the beast.&amp;nbsp; By insert and exploding at the same time, the block definition is never brought into the drawing. Just the objects themselves.&amp;nbsp; There is no drag preview.&amp;nbsp; If you want to insert and drag, you must.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1)Insert the external block as normal without exploding.&lt;/P&gt;
&lt;P&gt;2)Explode the block.&lt;/P&gt;
&lt;P&gt;3)Decide whether the block definition should be deleted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1)Have a program do the insert/explode and choose the point automatically (perhaps 0,0,0) instead of allowing the user to select the insertion point.&lt;/P&gt;
&lt;P&gt;2)Select the objects just placed and start the move command.&amp;nbsp; The program enters the first point as the basepoint and the pause is used by the user to drag.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These kinds of issues come up frequently on the newsgroup.&amp;nbsp; I would recommend that you learn how to search for the answers yourself before asking the question and then ask when those solutions don't work or need additional explanation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://lmgtfy.com/?q=Autolisp+insert+and+explode+drag" target="_blank"&gt;http://lmgtfy.com/?q=Autolisp+insert+and+explode+drag&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:45:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/6061767#M134180</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-02-29T15:45:52Z</dc:date>
    </item>
  </channel>
</rss>

