Jump to content

Exploding named blocks


Recommended Posts

Posted

Hi guys,

This is probably very easy using ssget or something, but I don't know exactly how that works. All I need to do is to explode any occurrences of a block with a particular name.

All the best

Maxelkat

Posted

This can be achieved without resorting to AutoLISP - just check the QSELECT or FILTER built-in commands.

Posted

...or in newer versions, select one of the blocks, right click, then select similar. That's one of my most used commands when cleaning up backgrounds.

Posted

Thanks Mircea and Rob. Both very useful commands that I wasn't previously aware of.

Is there a way to do it using script only, as ideally I'd want a batch engine to do the job for me?

Elliott Maxelkat

Posted

Using filters you can save a predefined filter and presumably load a filter (I've got an older AutoCAD and don't see a "Load" button)

 

So if you can indeed load a filter then just create your script an run the filter within your batch script.

 

Edit: It looks like it involves setting the "current" filter.

Posted

I'm not sure if the filter command can be controled from the command-line. So running it through a script might not work.

 

Personally if I need to explode one block throughout several DWGs, I'd use some lisp inside a script file which I'd run through AutoScript/ScriptPro/ som such. The lisp postion would be something like this:

(command "._EXPLODE" (ssget "_X" '((0 . "INSERT") (2 . "TheBlockName"))) "")

Note you can use wild-card matches on the name, so a comma would seperate 2 names, and asterisk (*) means any number of characters in this position. So say you want to explode the block named Test, but also all blocks starting with Bad... Then the dxf-code-2's filter string could look something like this:

"Test,Bad*"

Posted
I'm not sure if the filter command can be controled from the command-line. So running it through a script might not work.

 

Personally if I need to explode one block throughout several DWGs, I'd use some lisp inside a script file which I'd run through AutoScript/ScriptPro/ som such. The lisp postion would be something like this

 

Totally agree with you irneb. I wasn't certain how fluent in lisp the OP. But there's no time like now to dive in. Give it a try also Elliett.

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...