Explode/Purge command

Explode/Purge command

atrotto
Enthusiast Enthusiast
600 Views
11 Replies
Message 1 of 12

Explode/Purge command

atrotto
Enthusiast
Enthusiast

Hello all,

 

In my workflow I often have to pull a .dxf that has been exported from another program into AutoCAD. When I drag the file into Modelspace, AutoCAD makes that into a block.

 

This issue is that the file being imported is subject to revision within that external program, and when there is a block with the filename, the block overrides whatever newer version of the .dxf I'm trying to drag it in.

 

The fix for that is obviously exploding and purging that block, but I was wondering if anyone had a lisp that could just explode and purge a selected block(s) in one command, to avoid having to interface with the purge window. 

 

I figured I'd ask before I go and spend time putting it together myself, if someone already had this in their toolbelt. 

0 Likes
601 Views
11 Replies
Replies (11)
Message 2 of 12

pendean
Community Legend
Community Legend
OPEN command if you just want to open the DXF file and it not be a block.
Copy/Paste from there to another file will not create a block either.

But only Dragging any DXF or DWG is the same as using TPs, ADC and "insert" with no options, you'll always get a block 100% of the time: that's just how the program works. Although you can use tools like Design Center or ClassicInsert and choosing deliberately to 'explode' will stop the blocks from being created. This is what all a LISP will do anyway, use INSERT command with the EXPLODE option, but you won't be dragging/dropping either.

Do you still need a LISP?
0 Likes
Message 3 of 12

Moshe-A
Mentor
Mentor

@atrotto  hi,

 

This issue is that the file being imported is subject to revision within that external program, and when there is a block with the filename, the block overrides whatever newer version of the .dxf I'm trying to drag it in.

 

when you use drag & drop method to insert a dxf in, it is exactly the same as inserting a block\wblock\dwg file. if you try to insert an external block in and that block is already inside, autocad brings you the block that is already inside (to save process time) . if you want it to be replaced, you need to do an update block.

 

open the dxf file in autocad, save it as dwg

then use ADC command (AutoCAD Design Center) to bring an external block\file and update it.

this will save you time to clean the exiting block.

 

Moshe

 

0 Likes
Message 4 of 12

atrotto
Enthusiast
Enthusiast

I understand how AutoCAD works in this way, the issue is that the external program exports each piece of an "assembly" as separate .dxfs (there are usually 12+ pieces on one document) , so the fastest way I have found is to do the click-drag deal, then explode and purge all of the blocks together so that when the next guy comes in to this for a rev change, it isn't overridden.

 

What I'm attempting to accomplish is running a single command to "clean up" after click-and-drag placement of these pieces. 

0 Likes
Message 5 of 12

atrotto
Enthusiast
Enthusiast
I forgot to add, this piece shows up once in the entire drawing, so there is no benefit to keeping it as a block
0 Likes
Message 6 of 12

Kent1Cooper
Consultant
Consultant

Would it work for you to save the .DXF file to a .DWG, and XREF it into your target drawing, instead of dragging it in so that it's a Block?  Each time you got an update of the .DXF, you would need to send that to .DWG overwriting the previous version, but you would not need to do anything in the target drawing, because as an Xref the not-a-Block would update itself.

Kent Cooper, AIA
0 Likes
Message 7 of 12

atrotto
Enthusiast
Enthusiast

That sounds very sleek, unfortunately, the rev control software I am working under does not play nice with that sort of stuff.

 

The .dxfs are exported from the program (which maintains its own rev control within itself) to a folder on the user's desktop and are not treated as a control file whatsoever. The .dwg these all are compiled in are the controlled document. The .dxf is simply the transfer "image" between ecosystems. 

 

0 Likes
Message 8 of 12

pendean
Community Legend
Community Legend

@atrotto wrote:

...the rev control software I am working under ...


Why isn't the REV software renaming your DXF files? or you doin that from that software? REV1 REV2 REV3, so when you bring in your DXF file the only way you wish to ever do it, there will never be any overwriting of the old block name?

 

Just basic file version record keeping so to speak.

0 Likes
Message 9 of 12

paullimapa
Mentor
Mentor

Well, if you explode and purge the block, if there's another update and the dxf has to be pulled in again, how would you know what parts in the dwg that belonged to the original block should be erased?

Perhaps you do what @Kent1Cooper recommended which is to bring the dxf into a new dwg and give it a unique name.

Then attached this as an xref into the dwg.  Then you can xref bind it which converts it into a block insert prefixed with the name of the dwg in front. The next time you have to update the dxf repeat. But again give it a unique name. Then back in the dwg since you left it as a block, you can select and Erase that bound block and then xref attached the updated dxf and again xref bind...etc.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 10 of 12

atrotto
Enthusiast
Enthusiast

The rev software does not touch the .dxfs, the .dxfs are deleted as soon as they are transferred over to the document that has all of the pieces on it. That .dwg is rev controlled. The .dxf is basically just being used as transfer paper from one ecosystem to another, and is not kept. 

0 Likes
Message 11 of 12

atrotto
Enthusiast
Enthusiast
Each piece is labeled with its rev level as a text object on the piece. That's how it's exported from the other program. Part of our review process is to check that the rev on the pieces match the rev on the document, and that it all corresponds with the rev level in our rev control.
0 Likes
Message 12 of 12

Sea-Haven
Mentor
Mentor

Why not select all relevant dxf's filenames and dxfin each, explode and purge then all done. Yes can use VL-file-delete if happy with dxfin.

0 Likes