<?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: A better block insert in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966299#M85489</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/530473"&gt;@Draftsman13&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(myerr) function is missing.&lt;/P&gt;&lt;P&gt;to switch to other layer use "_make" option instead of "_set" this ensures layer creation if it not exist.&lt;/P&gt;&lt;P&gt;You insert a dynamic block with attribute and you BURST it, what's the point???&lt;/P&gt;&lt;P&gt;BURST is not a native command it's a lisp from express tools so you can invoke it like this: (c:burst) but in your lisp you can not feed your selection to burst's prompt select objects cause it's (ssget) which must be paused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my comments in red.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:sc1 (/ temperr *error* oldos oldor oldlayer p1 col) ; this starts the routine&lt;BR /&gt; &lt;FONT color="#FF0000"&gt;(graphscr)  ; this call should be the first&lt;/FONT&gt;
 (setq temperr *error*) ; saves *error*
 (setq *error* myerr) ; sets the new error variable&lt;BR /&gt;&lt;BR /&gt; &lt;FONT color="#FF0000"&gt;(setvar "cmdecho" 0)&lt;/FONT&gt;
 &lt;FONT color="#333300"&gt;&lt;STRIKE&gt;(command-s "_.undo" "_mark") ; start of "undo" command&lt;/STRIKE&gt;&lt;/FONT&gt;
 &lt;FONT color="#FF0000"&gt;(command "_.undo" "_begin")&lt;/FONT&gt;

 (setq oldos (getvar "osmode")) ; saves the current osnap settings
 (setvar "osmode" 0) ; sets new osnap settings&lt;BR /&gt;
 (setq oldor (getvar "orthomode")) ; saves the current ortho setting
 (setvar "orthomode" 1) ; turns the ortho on&lt;BR /&gt;&lt;BR /&gt; (if (setq p1 (getpoint "\nSelect column location ")) ; asks user to select a point&lt;BR /&gt;  (progn 
   (setq oldlayer (getvar "clayer")) ; saves the current layer
&lt;STRIKE&gt;   (command "_.-layer" "_set" "1ST_FL_NOTES" "") ; updates the current layer&lt;/STRIKE&gt;&lt;BR /&gt;   &lt;FONT color="#FF0000"&gt;(command "_.-layer" "_make" "1ST_FL_NOTES" "") ; use make option&lt;BR /&gt;&lt;/FONT&gt;   (command "_.-insert" "1st hss col" p1 "" "" "") ; inserts col block
   (setq col (entlast)) ; ties the block to the 'col' variable
   &lt;STRIKE&gt;(command "_.burst" col)&lt;/STRIKE&gt; &lt;FONT color="#FF0000"&gt;; burst is not a native command it's lisp command from express tools&lt;/FONT&gt;&lt;BR /&gt; ); progn
); if&lt;BR /&gt;
(setvar "osmode" oldos)    ; sets the osnaps to previous settings
(setvar "orthomode" oldor) ; restores the ortho to previous setting
(setvar "clayer" oldlayer) ; sets the current layer to previous setting

(setq *error* temperr) ; restores original error
&lt;FONT color="#FF0000"&gt;(command "._undo" "_end")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(setvar "cmdecho" 1)&lt;/FONT&gt; &lt;BR /&gt;
(princ)
) ; ends the command&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Aug 2019 17:01:29 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2019-08-14T17:01:29Z</dc:date>
    <item>
      <title>A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8964484#M85483</link>
      <description>&lt;P&gt;I need help once again.&amp;nbsp; I have a lisp routine to insert a dynamic block into a drawing.&amp;nbsp; This dynamic block contains mtext with stacked fractions.&amp;nbsp; Every now and then, the drawing will "lose" the fractions.&amp;nbsp; I think it may be the drawing containing the block gets inserted as a block and now I have two blocks referencing the same thing.&amp;nbsp; Is there a better way to insert/reference this block?&amp;nbsp; I want to keep it as an independent file so I can insert it into any drawing, so saving the block in my main file will not be a viable option.&amp;nbsp; Can utilizing layerstates be having some effect on this block.&amp;nbsp; I do have multiple layers in the block.&amp;nbsp; Here is my code for this operation and I have also included a copy of my block:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:sc1 (/ temperr *error* oldos oldor oldlayer p1 col) ; this starts the routine&lt;/P&gt;&lt;P&gt;(setq temperr *error*) ; saves *error*&lt;BR /&gt;(setq *error* myerr) ; sets the new error variable&lt;BR /&gt;(command-s "_.undo" "_mark") ; start of "undo" command&lt;BR /&gt;&lt;BR /&gt;(graphscr)&lt;BR /&gt;(setvar "cmdecho" 0)&lt;BR /&gt;(setq oldos (getvar "osmode")) ; saves the current osnap settings&lt;BR /&gt;(setvar "osmode" 0) ; sets new osnap settings&lt;BR /&gt;(setq oldor (getvar "orthomode")) ; saves the current ortho setting&lt;BR /&gt;(setvar "orthomode" 1) ; turns the ortho on&lt;BR /&gt;(setq oldlayer (getvar "clayer")) ; saves the current layer&lt;BR /&gt;&lt;BR /&gt;(command "_.-layer" "_set" "1ST_FL_NOTES" "") ; updates the current layer&lt;/P&gt;&lt;P&gt;(setq p1 (getpoint "\nSelect column location ")) ; asks user to select a point&lt;BR /&gt;(command "_.-insert" "1st hss col" p1 "" "" "") ; inserts col block&lt;/P&gt;&lt;P&gt;(setq col (entlast)) ; ties the block to the 'col' variable&lt;BR /&gt;(command "_.burst" col) ; burst the block&lt;BR /&gt;&lt;BR /&gt;(setvar "osmode" oldos) ; sets the osnaps to previous settings&lt;BR /&gt;(setvar "orthomode" oldor) ; restores the ortho to previous setting&lt;BR /&gt;(setvar "clayer" oldlayer) ; sets the current layer to previous setting&lt;/P&gt;&lt;P&gt;(setq *error* temperr) ; restores original error&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;) ; ends the command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a screen capture of what it looks like vs. what it should look like.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 390px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/666629iF7DF734F0675B252/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated because I hate doing the same thing multiple times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 23:21:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8964484#M85483</guid>
      <dc:creator>Draftsman13</dc:creator>
      <dc:date>2019-08-13T23:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8964696#M85484</link>
      <description>&lt;P&gt;Try these couple of suggestions just set dwg path correct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setvar 'clayer" "1ST_FL_NOTES" )

(if (= (tblsearch "block" "1st hss col") T)
(command "_.-insert" "1st hss col" p1 "" "" "") ; exists in dwg
(command "_.-insert" "c:\\mydegs\\1st hss col" p1 "" "" "") ; does not exist so bring in
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2019 02:41:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8964696#M85484</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-08-14T02:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8965816#M85485</link>
      <description>&lt;P&gt;Setting current layer to "1st_Fl_Notes" was written that way because it is supposed to create the layer if none existed in the drawing.&amp;nbsp; I have since found that to not be the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I like the idea of searching for the block before inserting, but my understanding was that if the block existed in the drawing, then the routine just used that one.&amp;nbsp; Is that not the case?&amp;nbsp; I have tried your coding, but cannot get it to work for some reason.&amp;nbsp; If I change the "\mydegs\" to the actual location of the file, it returns "invalid block name".&amp;nbsp; Also, it looks your check for the block existing is the same as my insert code, so I am not sure how that is a check.&amp;nbsp; Just trying to understand.&amp;nbsp; I do appreciate the input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if it makes a difference, but I should mention I am working on ACAD 2016&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 13:53:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8965816#M85485</guid>
      <dc:creator>Draftsman13</dc:creator>
      <dc:date>2019-08-14T13:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8965885#M85486</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;You can use the function &lt;A href="http://www.lee-mac.com/steal.html" target="_blank" rel="noopener"&gt;Steal Lee-Mac&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;a subfunction&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#008000"&gt;;; Insert-&amp;gt;Block
;; [STR] Nome do bloco&lt;/FONT&gt;

(defun Insert-&amp;gt;Block (nome)
  (if (not (tblsearch "BLOCK" nome))
    (and (Steal "&lt;FONT color="#FF0000"&gt;c:\\Block\\Block.dwg"&lt;/FONT&gt; (list (list "BLOCKS" (list nome)))) &lt;FONT color="#008000"&gt;;;&lt;/FONT&gt; &lt;FONT color="#008000"&gt;&amp;lt;&amp;lt; Location of your block&lt;/FONT&gt;
	 (command "_.Insert" nome pause 1 1 "" "_.Explode" "_Last" "")
    )
    (command "_.Insert" nome pause 1 1 "" "_.Explode" "_Last" "")
  )
)&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size="4"&gt;Example of use:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(Insert-&amp;gt;Block "Blockname")&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:14:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8965885#M85486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-14T14:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8965987#M85487</link>
      <description>&lt;P&gt;Can you explain how I would use this?&amp;nbsp; Do I replace "BLOCK" with the name of the block I am looking for and I change&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"&lt;FONT color="#FF0000"&gt;c:\\Block\\Block.dwg"&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;for the location on my hard drive?&amp;nbsp; is there anything else that needs to change?&amp;nbsp; How do I get my routine to activate the new defun?&amp;nbsp; If I make these changes and run the routine, it asks for a point and then exits the routine without inserting the block and without activating the error.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8965987#M85487</guid>
      <dc:creator>Draftsman13</dc:creator>
      <dc:date>2019-08-14T14:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966256#M85488</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;This is just an example !!&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="4"&gt;I attached a screencast (Sorry it was too long)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="4"&gt;And I don't know if this is what you're looking for&amp;nbsp; &amp;nbsp;lol&amp;nbsp;&lt;SPAN class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="iframe-container"&gt;&lt;IFRAME width="640" height="590" src="https://screencast.autodesk.com/Embed/Timeline/e3e763ba-75b1-4faa-a05e-cf498170dbdd" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 16:42:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966256#M85488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-14T16:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966299#M85489</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/530473"&gt;@Draftsman13&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(myerr) function is missing.&lt;/P&gt;&lt;P&gt;to switch to other layer use "_make" option instead of "_set" this ensures layer creation if it not exist.&lt;/P&gt;&lt;P&gt;You insert a dynamic block with attribute and you BURST it, what's the point???&lt;/P&gt;&lt;P&gt;BURST is not a native command it's a lisp from express tools so you can invoke it like this: (c:burst) but in your lisp you can not feed your selection to burst's prompt select objects cause it's (ssget) which must be paused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my comments in red.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:sc1 (/ temperr *error* oldos oldor oldlayer p1 col) ; this starts the routine&lt;BR /&gt; &lt;FONT color="#FF0000"&gt;(graphscr)  ; this call should be the first&lt;/FONT&gt;
 (setq temperr *error*) ; saves *error*
 (setq *error* myerr) ; sets the new error variable&lt;BR /&gt;&lt;BR /&gt; &lt;FONT color="#FF0000"&gt;(setvar "cmdecho" 0)&lt;/FONT&gt;
 &lt;FONT color="#333300"&gt;&lt;STRIKE&gt;(command-s "_.undo" "_mark") ; start of "undo" command&lt;/STRIKE&gt;&lt;/FONT&gt;
 &lt;FONT color="#FF0000"&gt;(command "_.undo" "_begin")&lt;/FONT&gt;

 (setq oldos (getvar "osmode")) ; saves the current osnap settings
 (setvar "osmode" 0) ; sets new osnap settings&lt;BR /&gt;
 (setq oldor (getvar "orthomode")) ; saves the current ortho setting
 (setvar "orthomode" 1) ; turns the ortho on&lt;BR /&gt;&lt;BR /&gt; (if (setq p1 (getpoint "\nSelect column location ")) ; asks user to select a point&lt;BR /&gt;  (progn 
   (setq oldlayer (getvar "clayer")) ; saves the current layer
&lt;STRIKE&gt;   (command "_.-layer" "_set" "1ST_FL_NOTES" "") ; updates the current layer&lt;/STRIKE&gt;&lt;BR /&gt;   &lt;FONT color="#FF0000"&gt;(command "_.-layer" "_make" "1ST_FL_NOTES" "") ; use make option&lt;BR /&gt;&lt;/FONT&gt;   (command "_.-insert" "1st hss col" p1 "" "" "") ; inserts col block
   (setq col (entlast)) ; ties the block to the 'col' variable
   &lt;STRIKE&gt;(command "_.burst" col)&lt;/STRIKE&gt; &lt;FONT color="#FF0000"&gt;; burst is not a native command it's lisp command from express tools&lt;/FONT&gt;&lt;BR /&gt; ); progn
); if&lt;BR /&gt;
(setvar "osmode" oldos)    ; sets the osnaps to previous settings
(setvar "orthomode" oldor) ; restores the ortho to previous setting
(setvar "clayer" oldlayer) ; sets the current layer to previous setting

(setq *error* temperr) ; restores original error
&lt;FONT color="#FF0000"&gt;(command "._undo" "_end")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(setvar "cmdecho" 1)&lt;/FONT&gt; &lt;BR /&gt;
(princ)
) ; ends the command&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2019 17:01:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966299#M85489</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-08-14T17:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966330#M85490</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I forgot to include the error code.&amp;nbsp; Your other suggestions make sense.&amp;nbsp; The "burst" command was a suggestion from a co-worker.&amp;nbsp; It was "explode" prior to that.&amp;nbsp; I store the dynamic block (SCOL-1) in a separate drawing (1st hss col).&amp;nbsp; The insert command is installing that drawing (1st hss col) as a block.&amp;nbsp; In order to get the dynamic block (SCOL-1) properties to work, I need to explode/burst the installed (1st hss col) block.&amp;nbsp; Hope that makes sense.&amp;nbsp; I like the idea of checking the drawing to see if the needed block is there, but at this point, I am unsure how to make that work.&amp;nbsp; I believe, if I can get the routine to use the block from the drawing instead of the stored drawing, I may be able to resolve the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 17:18:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966330#M85490</guid>
      <dc:creator>Draftsman13</dc:creator>
      <dc:date>2019-08-14T17:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966351#M85491</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;That is how I thought it worked.&amp;nbsp; Thank you for the screencast.&amp;nbsp; Steal does not see the block I am looking for in the current drawing I have it in.&amp;nbsp; I will play with it a little more tonight, when I have time.&amp;nbsp; I see some of the potential for the steal command and how to use it now.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 17:25:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966351#M85491</guid>
      <dc:creator>Draftsman13</dc:creator>
      <dc:date>2019-08-14T17:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966493#M85492</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/530473"&gt;@Draftsman13&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;I store the dynamic block (SCOL-1) in a separate drawing (1st hss col).&amp;nbsp; The insert command is installing that drawing (1st hss col) as a block.&amp;nbsp; In order to get the dynamic block (SCOL-1) properties to work, I need to explode/burst the installed (1st hss col) block.&amp;nbsp; Hope that makes sense.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;no it does not make sense. if you want to insert SCOL-1 than why don't you store the block it self in library folder that is on the AutoCAD support files search path that will save you the need to check if the block is already inside.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;burst and explode are not the same functions.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;your lisp is ok if you fix it according my comments plus wblock scol-1&amp;nbsp; out to library folder.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;moshe&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 18:39:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966493#M85492</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-08-14T18:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966913#M85493</link>
      <description>&lt;P&gt;You need to check also that "&lt;FONT&gt;StealV1-6.lsp&lt;/FONT&gt;" is loaded, there may be a later version.&lt;/P&gt;&lt;P&gt;(if (not steal)(load "&lt;FONT&gt;StealV1-6"))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;(Steal "C:\\My Folder\\MyDrawing.dwg"&amp;nbsp; etc&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 23:07:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8966913#M85493</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-08-14T23:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: A better block insert</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8967005#M85494</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Read the CAPITALISED comments in the code and adjust accordingly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun rh:burst ( obj / o_lyr o_col a_lst objs p_lst d_lst)
  (cond ( (vlax-method-applicable-p obj 'explode)
          (setq o_lyr (vlax-get-property obj 'layer)
                o_col (vlax-get-property obj 'color)
          );end_setq
          (cond ( (= (vlax-get-property obj 'hasattributes) :vlax-true)
                  (foreach att (vlax-invoke obj 'getattributes)
                    (if (= :vlax-true (vlax-get-property att 'visible))
                      (setq a_lst (cons (list (vlax-get-property att 'tagstring) (vlax-get-property att 'textstring)) a_lst))
                    );end_if
                  );end_foreach
                  (foreach att (vlax-invoke obj 'getconstantattributes)
                    (if (and (= :vlax-true (vlax-get-property att 'visible))
                             (= :vlax-false (vlax-get-property att 'invisible))
                        );end_and
                        (setq a_lst (cons (list (vlax-get-property att 'tagstring) (vlax-get-property att 'textstring)) a_lst))
                    );end_if
                  );end_foreach
                )
          );end_cond
          (setq objs (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-explode obj))))
          (foreach e_obj objs
            (cond ( (= (vlax-get-property e_obj 'objectname) "AcDbAttributeDefinition")
                    (setq p_lst (assoc (vlax-get-property e_obj 'tagstring) a_lst))
                    (cond ( (= :vlax-true (vlax-get-property e_obj 'invisible))
                            (vla-delete e_obj)
                          )
                          (
                            (setq e_obj (rh:convert2txt e_obj (nth 1 p_lst)))
                            (if (= (vlax-get-property e_obj 'layer) "0") (vlax-put-property e_obj 'layer o_lyr))
                            (if (= (vlax-get-property e_obj 'color) 0) (vlax-put-property e_obj 'color o_col))
                          )
                    );end_cond
                  );end_cond attribute
                  (t
                    (if (= (vlax-get-property e_obj 'layer) "0") (vlax-put-property e_obj 'layer o_lyr))
                    (if (= (vlax-get-property e_obj 'color) 0) (vlax-put-property e_obj 'color o_col))
                  )
            );end_cond
          );end_foreach
          (vla-delete obj)
          (foreach att d_lst (vla-delete att))
        )
        (
          (alert (strcat "Cannot Explode " (substr (vlax-get-property obj 'objectname) 5) " Objects"))
        )
  );end_cond
);end_defun

(vl-load-com)

(defun c:sc1 (/ *error* sv_lst sv_vals c_doc c_spc path_to pt blk obj tmp) ; this starts the routine
  
  (defun *error* ( msg )
    (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc)) ;close open mark
    (mapcar 'setvar sv_lst sv_vals)                                             ;reset system variables to entry state
    (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred.")))
    (princ)
  );_end_*error*_defun
  
  (setq sv_lst (list 'cmdecho 'osmode 'clayer)  ;list of system variables to save (entry state)
        sv_vals (mapcar 'getvar sv_lst)         ;get the values and save them as a list
        c_doc (vla-get-activedocument (vlax-get-acad-object))
        c_spc (vlax-get-property c_doc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))
        path_to "d:/saves/"   ;; CHANGE THIS TO THE PATH TO "1ST HSS COL.DWG". USE "/" AS THE PATH SEPARATOR AUTOCAD UNDERSTANDS THE UNIX "/" SEPARATOR 
        blk "SCOL-1"          ;; CHANGE THIS TO THE ACTUAL BLOCK NAME IN THE DRAWING
  );end_setq

  ;; check if layer is in drawing. if not create it
  (cond ( (not (tblsearch "layer" "1ST_FL_NOTES")) (vlax-put (vla-add (vla-get-layers c_doc) "1ST_FL_NOTES") 'color 1))) ;; CHANGE THE FINAL 1 TO THE COLOUR YOU WANT FOR LAYER 1ST_FL_NOTES

  (mapcar 'setvar sv_lst '(0 0 "1ST_FL_NOTES"))
  
  (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
  (vla-startundomark c_doc)
  
  (setq pt (getpoint "\nSelect Column Location : ")) ; asks user to select a point
  
  ;; check if block is in drawing. if not import it
  (cond ( (not (tblsearch "block" blk))
          (setq tmp (strcat path_to "1st hss col.dwg"))           ;construct path string to drawing containing the block
          (command "_-insert" tmp pt "" "" "")                    ;insert the drawing (will automatically add the block inside to the block table)
          (command "_erase" (entlast) "")                         ;erase the last entity (drawing containing block)
        )
  );end_cond
  
  (setq obj (vla-insertblock c_spc (vlax-3d-point pt) blk 1 1 1 0))           ;Insert the block stored in variable &lt;FONT color="#FF0000"&gt;blk&lt;/FONT&gt; at &lt;FONT color="#FF0000"&gt;pt&lt;/FONT&gt; scale &lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt; rotation &lt;FONT color="#FF0000"&gt;0 (radians)&lt;/FONT&gt;
  (rh:burst obj)                                                              ;burst the object
  
  (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc)) ;close open mark
  (mapcar 'setvar sv_lst sv_vals)                                             ;reset system variables to entry state
  (princ)
);end_defun&lt;/PRE&gt;&lt;P&gt;I cannot open your attached drawing as I'm using AutoCAD 2012, so not tested using your block. Any problems let me know&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 00:55:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/a-better-block-insert/m-p/8967005#M85494</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2019-08-15T00:55:06Z</dc:date>
    </item>
  </channel>
</rss>

