Express tool does not work using AutoLISP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all.
I'm trying to use the BURST command in the AutoLISP but it says that the command is unknown. But I have the Express tools installed and I can use this command in AutoCAD. I have reinstalled and fixed the software, but still gets the same error message.
This is my AutoLISP code:
(defun c:BurstAll (/ ss ent obj)
(vl-load-com) ; Load Visual LISP functions
(setq ss (ssget "X" '((0 . "INSERT")))) ; Select all block references in the drawing
(if ss
(progn
(setq i 0)
(repeat (sslength ss)
(setq ent (ssname ss i)) ; Get entity name
(setq obj (vlax-ename->vla-object ent)) ; Convert entity name to VLA-object
; Check if the block has attributes (Burst only works on blocks with attributes)
; If you want to burst all blocks, even without attributes, you'd modify this.
; However, Burst's primary purpose is to explode blocks while retaining attribute values.
(if (vlax-property-available-p obj 'HasAttributes)
(progn
(if (eq :vlax-true (vla-get-hasattributes obj))
(progn
(command "BURST" ent "") ; Execute the Burst command on the block
(princ (strcat "\nBursting block: " (vla-get-effectivename obj))) ; Print block name to command line
)
(princ (strcat "\nSkipping block (no attributes): " (vla-get-effectivename obj)))
)
)
(princ (strcat "\nSkipping block (not an attribute block): " (vla-get-effectivename obj)))
)
(setq i (1+ i))
)
(princ "\nFinished bursting all eligible blocks.")
)
(princ "\nNo blocks found in the drawing.")
)
(princ) ; Suppress nil return
)