I've got to be overthinking this (or underthinking it):
I use (setq AllBlocks (ssget "X" (list (cons 0 "INSERT")))) to select all the blocks in a drawing.
If I manually run the Explode command and enter !AllBocks at the command line for the selection all the blocks are exploded in one fell swoop If, in a lisp routine I use (command "explode" AllBlocks "") or (command "explode" "!AllBlocks" "") i don't get the same result. I can use a loop to explode one block at a time until they're done, but that takes quite a bit longer. What am I missing?
The purpose of this is to help convert our 3D assemblies, made up of blocks containing solid entities, into a model with only solids so the ACISOUT command can be used.
Any help would be appreciated,
Mike
Nope, no change. Still doesn't allow me to explode the selection set of blocks in one operation.
Mike
Try searching the Discussion Group history for QAFLAGS. There have been many threads on this issue, and that has always been at least part of the solution, but you might find one that says more.
Fat Finger Syndrome (a typo) had me thinking it didn't work, when in fact it *does* work. Sorry about that guys. I need to slow down, or better yet get my boss to lay off the whip 😛
Thanks very much for the help, it is greatly appreciated.
Mike
edit:
Here is the basic routine to explode blocks, including nested, while preserving Solids for export to an ACIS file:
(defun C:ACISPrep (/ AllBlocks SolOnly )
(setvar "qaflags" 1)
(setq AllBlocks (ssget "X" (list (cons 0 "INSERT"))))
(while (/= AllBlocks nil)
(progn
(command "_.explode" AllBlocks "")
(setq AllBlocks (ssget "X" (list (cons 0 "INSERT"))))
);progn
);while
(if (= AllBlocks nil)(alert "All blocks were exploded"))
(setq SolOnly (ssget "X" '((0 . "3DSOLID"))))
(command "_.erase" "all" "R" SolOnly "")
(alert "All non-Solid entities deleted. Purge file before exporting to ACIS.")
(setvar "qaflags" 0)
(princ)
);end ACISPrep
Thanks again!
Hello CADDapult,
I am using your function ACISPrep, which work's great, the only problem i have is that it keeps freezing when i am using a script file (for batch processing )!!!
calling this script like this:
(ACISPrep )
this is the output of script :
Command: _.explode
Select objects: 264 found
Select objects:
Command: _.erase
Select objects: all 2504 found
Select objects: R
Remove objects: <---get stuck's her!!
i've modifed it to remove all the alerts:
(defun ACISPrep (/ AllBlocks SolOnly ) (setvar "qaflags" 1) (setq AllBlocks (ssget "X" (list (cons 0 "INSERT")))) (while (/= AllBlocks nil) (progn (command "_.explode" AllBlocks "") (setq AllBlocks (ssget "X" (list (cons 0 "INSERT")))) );progn );while (setq SolOnly (ssget "X" '((0 . "3DSOLID")))) (command "_.erase" "all" "R" SolOnly "") (setvar "qaflags" 0) (princ) );end ACISPrep
Thank you
Wow!! This is the word I used to describe the action of your lisp file. All blocker were exploded.
I had the numbers but this website timed out before I got back to adding them.
This is a very large conveyor drawing and it worked great.
Then I used:
(command "_move""_all""""""0,0,1e99""_move""_all""""""0,0,-1e99")
to get them to true 0,0,0 care of https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/how-to-f...
Then I used OVERKILL to take out the unwanted lines and circles due to multi stories being taken down to 1.
Thanks!! JRR.