Maxelkat Posted December 6, 2012 Posted December 6, 2012 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 Quote
MSasu Posted December 6, 2012 Posted December 6, 2012 This can be achieved without resorting to AutoLISP - just check the QSELECT or FILTER built-in commands. Quote
RobDraw Posted December 6, 2012 Posted December 6, 2012 ...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. Quote
Maxelkat Posted December 6, 2012 Author Posted December 6, 2012 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 Quote
Patrick Hughes Posted December 6, 2012 Posted December 6, 2012 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. Quote
Maxelkat Posted December 7, 2012 Author Posted December 7, 2012 Thanks Patrick, I'll try that. Elliott Quote
irneb Posted December 7, 2012 Posted December 7, 2012 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*" Quote
Patrick Hughes Posted December 7, 2012 Posted December 7, 2012 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. Quote
Recommended Posts
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.