convert dynamic block visibility to static

convert dynamic block visibility to static

yann26L6EPT
Explorer Explorer
991 Views
13 Replies
Message 1 of 14

convert dynamic block visibility to static

yann26L6EPT
Explorer
Explorer

Hi everyone,
I have some issue with a lips created by  dlanorh, it seem not to work when your are dynamic block without attribute. I ask some improved to dlanorh, but it seem to disaperar since 2021.
https://forums.autodesk.com/t5/dynamic-blocks-forum/dynamic-block-visibility-into-individual-block/t...

 

I want to use your undynamic script but something is wrong on version 2023 in autocad, it says "Nothing Found" but you can see there a visibility state and I need to be explose in block name visibility

 

 

 

(defun LM:getvisibilityparametername ( blk / vis )
    (if (and (vlax-property-available-p blk 'effectivename)
             (setq blk (vla-item (vla-get-blocks (vla-get-document blk)) (vla-get-effectivename blk)))
             (= :vlax-true (vla-get-isdynamicblock blk))
             (= :vlax-true (vla-get-hasextensiondictionary blk))
             (setq vis (vl-some '(lambda (pair) (if (and (= 360 (car pair)) (= "BLOCKVISIBILITYPARAMETER" (cdr (assoc 0 (entget (cdr pair)))))) (cdr pair)))
                         (dictsearch (vlax-vla-object->ename (vla-getextensiondictionary blk)) "ACAD_ENHANCEDBLOCK")
                       )
             )
        )
        (cdr (assoc 301 (entget vis)))
    )
);end_defun

(defun LM:getvisibilitystate ( blk / vis ) (if (setq vis (LM:getvisibilityparametername blk)) (LM:getdynpropvalue blk vis)))

(defun LM:setdynpropvalue ( blk prp val )
    (setq prp (strcase prp))
    (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-put x 'value val))) (vlax-invoke blk 'getdynamicblockproperties)
    )
);end_defun

(defun LM:getdynpropvalue ( blk prp )
  (setq prp (strcase prp))
  (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value))) (vlax-invoke blk 'getdynamicblockproperties))
);end_defun

(defun rh:has_tag (o tg) (vl-some '(lambda (x) (= tg (strcase (vla-get-tagstring x)))) (vlax-invoke o 'getattributes)))

(defun rh:dbe ( blk doc lyr )
  (vlax-for obj (vla-item (vlax-get-property doc 'blocks) blk)
    (cond ( (and (/= (vla-get-layer obj) lyr)
                 (not (wcmatch (strcase (vlax-get-property obj 'objectname)) "*ENTITY*"))
            )
            (vla-delete obj)
          )
    )
  )
);end_defun

(vl-load-com)

;Dynamic to Static Block By visibility state
(defun c:d2sbv ( / *error* c_doc c_spc sv_lst sv_vals tag flg obj o d vn en prp val f ss cnt obj bn ang vn ipt n_obj nbn)

  (defun *error* ( msg )
    (mapcar 'setvar sv_lst sv_vals)
    (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred.")))
    (princ)
  );end_local_*error*_defun

  (setq c_doc (vlax-get-property (vlax-get-acad-object) 'activedocument)
        c_spc (vlax-get-property c_doc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))
        sv_lst (list 'cmdecho 'osmode)
        sv_vals (mapcar 'getvar sv_lst)
  );end_setq

  (mapcar 'setvar sv_lst '(0 0))

;user settings
  (setq tag "STATION-NO")

  (while (not flg)
    (setq obj (vlax-ename->vla-object (car (entsel "\nSelect One of the Dynamic Blocks to Convert : "))))
    (cond ( (and (= (setq o (vlax-get obj 'objectname)) "AcDbBlockReference")
                 (= :vlax-true (setq d (vlax-get-property obj 'isdynamicblock)))
                 (setq vn (LM:getvisibilitystate obj))
            );end_and
            (setq en (vlax-get obj 'effectivename) flg T prp (LM:getvisibilityparametername obj))
            (cond ( (or (= :vlax-false (vlax-property-available-p obj 'hasattributes)) (not tag) (not (rh:has_tag obj tag))) (setq val 0)))
          )
          (t 
            (cond ( (/= o "AcDbBlockReference") (setq msg "NOT a Block"))
                  ( (= d :vlax-false) (setq msg "NOT a Dynamic Block"))
                  ( (not vn) (setq msg "Block has NO Visibility Parameter"))
            );end_cond
            (alert msg)
          )
    );end_cond
  );end_while

  (setq ss (ssget "_A" '((0 . "INSERT") (66 . 1) (410 . "Model"))))
  (cond (ss
          (repeat (setq cnt (sslength ss))
            (setq obj (vlax-ename->vla-object (ssname ss (setq cnt (1- cnt))))
                  bn (vlax-get obj 'effectivename)
            );end_setq

            (cond ( (= bn en)
                    (setq ang (lm:getdynpropvalue obj "angle1")
                          vn (LM:getvisibilitystate obj)
                          ipt (vlax-get obj 'insertionpoint)
                          n_obj (vlax-invoke c_spc 'insertblock ipt en 1 1 1 0)
                    );end_setq

                    (LM:setdynpropvalue n_obj prp vn)

                    (if (numberp val)
                      (setq val (1+ val) nbn (strcat vn "_" (itoa val)))
                      (setq val (vl-some '(lambda (x) (if (= tag (strcase (vla-get-tagstring x))) (vla-get-textstring x))) (vlax-invoke obj 'getattributes))
                            nbn (strcat vn "_" val)
                      );end_setq
                    );end_if

                    (vla-converttostaticblock n_obj nbn)
                    (rh:dbe nbn c_doc "0")
                    (vla-delete n_obj)
                    (setq n_obj (vlax-invoke c_spc 'insertblock ipt nbn 1 1 1 ang))
                    (mapcar '(lambda (x) (vlax-put-property n_obj x (vlax-get-property obj x))) (list 'layer 'truecolor 'xscalefactor 'yscalefactor 'zscalefactor))
                    (vla-delete obj)
                  )
            );end_cond
          );end_repeat
        )
        (t (alert "Nothing Found"))
  );end_cond

  (vla-purgeall c_doc)
  (vla-regen c_doc acallviewports)

  (mapcar 'setvar sv_lst sv_vals)
  (princ)
);end_defun

 

If I understand his code, I need some modification here : (setq ss (ssget "_A" '((0 . "INSERT") (66 . 1) (410 . "Model")))), but dbe function not work after. Please can you look something? In attchment you can see lips and example file with block.

Thanks in advance, 

Sincerly

0 Likes
992 Views
13 Replies
Replies (13)
Message 2 of 14

Moshe-A
Mentor
Mentor

@yann26L6EPT hi,

 

Here is a more simple command DYN2STAT based on (vla-convertToAnonymousBlock) function which result static anonymous block.

 

the RENANO command will than let you to rename the new anonymous block to a meaningful block name.

you can only pick one at a time block to rename.

 

enjoy

Moshe

 

(vl-load-com) ; load ActiveX support

; convert dynamic block to static
(defun c:dyn2stat (/ ss ename AcDbblkRef)
 (if (setq ss (ssget '((0 . "insert"))))
  (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
    (setq AcDbBlkRef (vlax-ename->vla-object ename))
    (if (eq (vla-get-isDynamicBlock AcDbBlkRef) :vlax-true)
      (vl-catch-all-apply 'vla-ConvertToAnonymousBlock (list AcDbBlkRef))
    ); if

    (vlax-release-object AcDbBlkRef) ; dispose memory
  ); foreach
 ); if

 (princ)
) ; c:dyn2stat


(defun c:renano (/ ss ename oldBName newBName blocks AcDbBlkTblRec SuccessBlockRename)
 (if (not (setq ss (ssget ":s:e+." '((0 . "insert") (2 . "`*U*")))))
  (progn
   (vlr-beep-reaction)
   (princ "\nObject selected is not a block or block is not anonymous.")
  ); progn
  (progn
   (redraw (setq ename (ssname ss 0)) 3)
   (princ (strcat "\nOld block name: " (setq oldBName (cdr (assoc '2 (entget ename))))))

   (while (and (not SuccessBlockRename)
	       (/= (setq newBName (getstring "\nNew block name: ")) "")
	  )
    (setq blocks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
    (cond
     ((vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list blocks newBName)))
      (setq AcDbBlkTblRec (vla-item blocks oldBName))
      (vla-put-name AcDbBlkTblRec newBName)
      (setq SuccessBlockRename t)
      (vlax-release-object AcDbBlkTblRec) ; dispose memory
     ); case
     ( t
      (vlr-beep-reaction)
      (princ (strcat "\nBlock \"" newBName "\" is already exist."))
     ); case
    ); cond

    (vlax-release-object blocks) ; dispose memory
   ); while

   (redraw ename 4)
  ); progn
 ); if

 (princ)
); c:renano

 

0 Likes
Message 3 of 14

yann26L6EPT
Explorer
Explorer

Hi,
Thanks for your code, I will test.
But I have a lot of block, it will not very efficiency methode for my files. Please, can I ask you to look d2sb code : I have a issue with dbe funtion when I replace by this line to use block without attribute :

(setq ss (ssget "_A" '((0 . "INSERT") (66 . 1) (410 . "Model"))))

by this line to use block without attribute

(setq ss (ssget "_A" (list '(0 . "INSERT") (cons 2 "`*U*") '(410 . "Model"))))

 

 Thanks in advance

0 Likes
Message 4 of 14

Moshe-A
Mentor
Mentor

@yann26L6EPT ,

 

first test my solution and if it does not work post your dwg and explain why?

 

Moshe

 

0 Likes
Message 5 of 14

yann26L6EPT
Explorer
Explorer

Hi @Moshe-A,

It's works thanks you, I have post example dwg at first and complete file here.
the issue is just I have a lot of file that I need to make this transformation all and something like 251 blocks in just this file. =>lot of time to just rename

0 Likes
Message 6 of 14

yann26L6EPT
Explorer
Explorer

I can't find, I have some issue when I split together and add visibility name :

(vl-load-com) ; load ActiveX support

(defun LM:getvisibilityparametername (blk / vis)
  (princ "\nLM:getvisibilityparametername called")
  (if (and (vlax-property-available-p blk 'effectivename)
           (setq blk (vla-item (vla-get-blocks (vla-get-document blk)) (vla-get-effectivename blk)))
           (= :vlax-true (vla-get-isdynamicblock blk))
           (= :vlax-true (vla-get-hasextensiondictionary blk))
           (setq vis (vl-some '(lambda (pair) (if (and (= 360 (car pair)) (= "BLOCKVISIBILITYPARAMETER" (cdr (assoc 0 (entget (cdr pair)))))) (cdr pair)))
                              (dictsearch (vlax-vla-object->ename (vla-getextensiondictionary blk)) "ACAD_ENHANCEDBLOCK"))
           )
      )
      (cdr (assoc 301 (entget vis)))
  )
); end_defun

(defun LM:getvisibilitystate (blk / vis)
  (princ "\nLM:getvisibilitystate called")
  (if (setq vis (LM:getvisibilityparametername blk))
      (progn (princ "\nVisibility state obtained: ")(princ vis)(LM:getdynpropvalue blk vis))
  )
)

(defun LM:setdynpropvalue (blk prp val)
  (princ "\nLM:setdynpropvalue called")
  (setq prp (strcase prp))
  (princ "\nProperty name: ")(princ prp)
  (vl-some '(lambda (x) (if (= prp (strcase (vla-get-propertyname x))) (vlax-put x 'value val))) (vlax-invoke blk 'getdynamicblockproperties))
); end_defun

(defun LM:getdynpropvalue (blk prp)
  (princ "\nLM:getdynpropvalue called")
  (setq prp (strcase prp))
  (princ "\nProperty name: ")(princ prp)
  (vl-some '(lambda (x) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value))) (vlax-invoke blk 'getdynamicblockproperties))
); end_defun

(defun c:renano (oldBName newBName / blocks AcDbBlkTblRec SuccessBlockRename)
  (princ "\nc:renano called")
  (princ (strcat "\noldBName: " oldBName))
  (princ (strcat "\nnewBName: " newBName))
  (setq SuccessBlockRename nil)
  (while (and (not SuccessBlockRename)
              (/= newBName "")
         )
    (setq blocks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
    (cond
      ((vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list blocks newBName)))
       (setq AcDbBlkTblRec (vla-item blocks oldBName))
       (vla-put-name AcDbBlkTblRec newBName)
       (setq SuccessBlockRename t)
       (vlax-release-object AcDbBlkTblRec) ; dispose memory
      ); case
      (t
       (vlr-beep-reaction)
       (princ (strcat "\nBlock \"" newBName "\" already exists."))
       (setq newBName (getstring "\nEnter a different new block name: "))
      ); case
    ); cond
    (vlax-release-object blocks) ; dispose memory
  ); while
  (princ (strcat "\nBlock renamed to: " newBName))
); c:renano

(defun c:dyn2stat (/ ss ename AcDbBlkRef visState newName)
  (princ "\nc:dyn2stat called")
  (if (setq ss (ssget '((0 . "insert"))))
    (progn
      (princ "\nSelection set obtained")
      (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
        (princ "\nProcessing entity: ")(princ ename)
        (setq AcDbBlkRef (vlax-ename->vla-object ename))
        (princ "\nObject name: ")(princ (vla-get-objectname AcDbBlkRef))
        (if (eq (vla-get-isDynamicBlock AcDbBlkRef) :vlax-true)
          (progn
            (princ "\nIs a dynamic block")
            (setq visState (LM:getvisibilitystate AcDbBlkRef))
            (princ "\nVisibility state: ")(princ visState)
            (vl-catch-all-apply 'vla-ConvertToAnonymousBlock (list AcDbBlkRef))
            (if (and visState (stringp visState))
              (progn
                (setq newName (strcat (vla-get-effectivename AcDbBlkRef) "_" visState))
                (princ (strcat "\nAttempting to rename block to: " newName))
                (c:renano (vla-get-effectivename AcDbBlkRef) newName) ; call c:renano function to rename anonymous block
              )
            )
          )
        )
        (vlax-release-object AcDbBlkRef) ; dispose memory
      ); foreach
    ); progn
  ); if
  (princ "\nFinished processing")
  (princ)
); c:dyn2stat

 

0 Likes
Message 7 of 14

Moshe-A
Mentor
Mentor

@yann26L6EPT ,

 

Your initial request was to convert a dynamic block with visibility to static block - am i wrong?!

i gave you a nice solution that you says - it works 😀

i gave you the RENANO only as a completion to DYN2STAT (it wasn't your request) to rename the new static block to meaningful block name.

 

Now you says i want to rename about 250 converted blocks and it is alot of time?

so tell me how do you expect it should work? cause you know, you need to supply your new block names to RENANO

from where it will take your list of block names (it's in your head)

and how it would know which name to give  to which block?

 

Moshe

 

 

  

 

0 Likes
Message 8 of 14

yann26L6EPT
Explorer
Explorer


Hello @Moshe-A ,

I'm sorry if I expressed myself poorly. Initially, I found a code that works but is not suited to my case since it automatically converts dynamic blocks with visibility and WITH attributes into static ones with the name contained in the visibility.

My initial request was to adapt this code so that it could also handle or just a dynamic block with visibility WITHOUT attributes, still with the same logic of renaming it with the name contained in the visibility.

To summarize my initial request for my problem, it is to simplify my workflow by:

  • only processing the blocks selected before launching the command,
  • transforming these blocks from dynamic with visibilities (typically for traffic lights bae/322/222) into static ones renamed, for example, 322, while keeping the scale, orientation, etc.

Thank you for your time and I apologize for the misunderstanding.

0 Likes
Message 9 of 14

marko_ribar
Advisor
Advisor

@yann26L6EPT 

You don't have (stringp) function... I suggest that you use (snvalid) instead...

For info, look here : https://help.autodesk.com/view/ACDLT/2024/ENU/?guid=GUID-FAD2CDD5-50CD-4328-B391-C898AAD4E401 

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 10 of 14

Moshe-A
Mentor
Mentor

@yann26L6EPT,

 

I wonder why would one want to take a sophisticate \ advanced dynamic block with attributes and D E S T R O Y  it?

is it cause you do not know how to work \ handle dynamic blocks, why not learn?

 

Another solution could be building your own static attributes less blocks and replace the advance ones.

 

Moshe

 

0 Likes
Message 11 of 14

yann26L6EPT
Explorer
Explorer
Hello @Moshe-A ,
I completely agree with you, especially since those blocks are really good (they were not created by me), but my task is to create plans according to a very specific (archaic) standard. Therefore, I must break down the blocks, remove all the xrefs, and clean the original plan (including all elements) to produce a very minimalist topographic drawing and data for traffic lights (with their blocks named in a certain static way).

Right now, I'm manually replacing them with their static blocks based on what I see visually (because in the dynamic blocks, there is a traffic light with a diameter of 300mm as well as one of 200mm). It's long, tedious, and silly, hence my search for a script. After the dynstat script, I will use a blockreplace script for their silly blocks (but I see no other way to do it).

In other words, nothing belongs to me, I'm just the intermediary who standardizes the plans.

Unless I'm mistaken, I can't just replace them because I lose the information about what it was since the type of light is defined in the visibility. a norm
0 Likes
Message 12 of 14

yann26L6EPT
Explorer
Explorer
hi @marko_ribar,
Thanks for the tip, I will see help
0 Likes
Message 13 of 14

yann26L6EPT
Explorer
Explorer

hi 
Please someone can help me?
I can't solve by using snvalid
Thanks in advance

0 Likes
Message 14 of 14

Moshe-A
Mentor
Mentor

@yann26L6EPT  hi,

 

ok check this one.

 

Many thanks to Mr Lee Mac for the magnificent functions to deal with dynamic blocks with out them this could not be born 😀

 

if it doesn't work post, post your dwg.

 

enjoy

Moshe

 

 

 

 

(vl-load-com) ; load ActiveX support

;; Get Dynamic Block Property Value  -  Lee Mac
;; Returns the value of a Dynamic Block property (if present)
;; blk - [vla] VLA Dynamic Block Reference object
;; prp - [str] Dynamic Block property name (case-insensitive)

(defun LM:getdynpropvalue ( blk prp )
    (setq prp (strcase prp))
    (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
        (vlax-invoke blk 'getdynamicblockproperties)
    )
)

;; Get Visibility Parameter Name  -  Lee Mac
;; Returns the name of the Visibility Parameter of a Dynamic Block (if present)
;; blk - [vla] VLA Dynamic Block Reference object
;; Returns: [str] Name of Visibility Parameter, else nil

(defun LM:getvisibilityparametername ( blk / vis )  
    (if
        (and
            (vlax-property-available-p blk 'effectivename)
            (setq blk
                (vla-item
                    (vla-get-blocks (vla-get-document blk))
                    (vla-get-effectivename blk)
                )
            )
            (= :vlax-true (vla-get-isdynamicblock blk))
            (= :vlax-true (vla-get-hasextensiondictionary blk))
            (setq vis
                (vl-some
                   '(lambda ( pair )
                        (if
                            (and
                                (= 360 (car pair))
                                (= "BLOCKVISIBILITYPARAMETER" (cdr (assoc 0 (entget (cdr pair)))))
                            )
                            (cdr pair)
                        )
                    )
                    (dictsearch
                        (vlax-vla-object->ename (vla-getextensiondictionary blk))
                        "ACAD_ENHANCEDBLOCK"
                    )
                )
            )
        )
        (cdr (assoc 301 (entget vis)))
    )
)


;; Get Dynamic Block Visibility State  -  Lee Mac
;; Returns the value of the Visibility Parameter of a Dynamic Block (if present)
;; blk - [vla] VLA Dynamic Block Reference object
;; Returns: [str] Value of Visibility Parameter, else nil

(defun LM:getvisibilitystate ( blk / vis )
    (if (setq vis (LM:getvisibilityparametername blk))
        (LM:getdynpropvalue blk vis)
    )
)


; convert dynamic block to static
(defun c:dyn2stat (/ modify_block delete_attributes ; local functions
		     doc blocks ss ename AcDbBlkRef curVisState)
  
 (defun modify_block (visState AcDbObjRef / generate_block_name  ; local function
		        		    cBName nBName AcDbObjTblRec)
 
  (defun generate_block_name (bname / i result)
   (setq i 1)
   (while (tblsearch "block" (setq result (strcat bname "&" (itoa i))))
    (setq i (1+ i))
   ); while

   result
  ); generate_block_name


  (setq cBName (vla-get-name AcDbObjRef))
  (setq nBName (generate_block_name visState))
	
  (setq AcDbObjTblRec (vla-item blocks cBName))

  (vlax-for AcDbEntity AcDbObjTblRec
   (if (eq (vla-get-objectName AcDbEntity) "AcDbAttributeDefinition")
    (progn
     (setq tagName (vla-get-tagString AcDbEntity))
     
     (foreach AcDbAttrib (vlax-invoke AcDbObjRef 'GetAttributes)
      (setq o AcDbAttrib)
      (if (eq (strcase (vla-get-tagString AcDbAttrib)) (strcase tagName))
       (progn
        (setq AcDbText (vla-addText AcDbObjTblRec (vla-get-textString AcDbEntity) (vla-get-insertionPoint AcDbEntity) (vla-get-height AcDbEntity)))
	(vla-put-layer AcDbText (vla-get-layer AcDbAttrib))
	(vla-put-obliqueAngle AcDbText (vla-get-obliqueAngle AcDbAttrib))
	(vla-put-rotation AcDbText (vla-get-rotation AcDbAttrib))
	(vla-put-scaleFactor AcDbText (vla-get-scaleFactor AcDbAttrib))
	(vla-put-stylename AcDbText (vla-get-styleName AcDbAttrib))
	
       ;| next is disabled cause it does not work
        (if (vlax-property-available-p AcDbAttrib 'TextAlignmentPoint)
	 (vla-put-TextAlignmentPoint AcDbText (vlax-3d-point (vlax-safearray->list (vlax-variant-value (vla-get-TextAlignmentPoint AcDbAttrib)))))
	)
	
	(if (vlax-property-available-p AcDbAttrib 'TextGenerationFlag)
	 (vla-put-TextGenerationFlag AcDbText (vla-get-TextGenerationFlag AcDbAttrib))
	)|;
	
	(vla-put-textString AcDbText (vla-get-textString AcDbAttrib))
	(vla-put-trueColor AcDbText (vla-get-trueColor AcDbAttrib))
	(vla-put-upsideDown AcDbText (vla-get-upsideDown AcDbAttrib))
       ); progn
      ); if

      (vla-delete AcDbAttrib)
      (vlax-release-object AcDbAttrib)
     ); foreach
    
     (vla-delete AcDbEntity)
    ); progn
   ); if

   (vlax-release-object AcDbEntity)
  ); vlax-for
   
  (vla-put-name AcDbObjTblRec nBName)
  (vlax-release-object AcDbObjTblRec)
 );  modify_block

   
 ; here start dyn2star
 (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
 (vla-startUndoMark adoc)
   
 (setq blocks (vla-get-blocks adoc))
  
 (if (setq ss (ssget '((0 . "insert"))))
  (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (setq AcDbBlkRef (vlax-ename->vla-object ename))

   (if (eq (vla-get-isDynamicBlock AcDbBlkRef) :vlax-true)
    (cond
     ((setq curVisState (LM:getvisibilitystate AcDbBlkRef))

      (if (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-ConvertToAnonymousBlock (list AcDbBlkRef))))
       (modify_block curVisState AcDbBlkRef)
      ); if
     ); case
    ); cond
   ); if
    
   (vlax-release-object AcDbBlkRef) ; dispose memory
  ); foreach
 ); if

 (vlax-release-object blocks)

 (vla-endUndoMark adoc)
 (vlax-release-object adoc)
   
 (princ)
) ; c:dyn2stat
0 Likes