Jump to content

AutoLISP: Safe alternative to (command "EXPLODE") inside a custom command


Recommended Posts

Posted

I am working on an AutoLISP routine where I need to explode a block/table object during the execution of my custom command.

Currently I am using:

(command "._EXPLODE" obj "")

The object is exploded, and my routine usually continues, but AutoCAD also prints an “Unknown command” message after the EXPLODE operation. When I remove this EXPLODE line, the problem disappears.

From what I understand, the issue may be related to using the AutoCAD EXPLODE command inside another running AutoLISP command. After the explode operation, AutoCAD may refresh or lose the expected command context, so the remaining input is interpreted incorrectly.

I need to explode the object because I have to access/fill attribute-related data from the resulting entities. However, I must preserve the original block/table placement exactly: insertion point, rotation, scale, and geometry position should remain unchanged. It would also be acceptable if only the entities on a specific layer are exploded or copied out.

Is there a safer/custom AutoLISP or Visual LISP way to explode a block/table object without using (command "._EXPLODE" ...)?

For example, is using vla-Explode recommended in this case? If so, how can I explode or copy the block contents while preserving their transformed position, rotation, and scale exactly as they appear in the drawing?

Any example function or best-practice approach would be helpful.

Posted

Have you tried vla-explode?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...