@mwhea wrote:..... Will this fail if the selection set of blocks is greater then the maximum allowed by AutoCAD (32767) ?? ....
I'm afraid I may not put that many Blocks, of all kinds combined, into all the drawings I work on in a year, so I couldn't say. If the maximum allowed means that trying to put more into a selection set will cause an error, then I would assume the answer is yes. If it only means that the selection set won't have everything eligible in it, but will still be viable with whatever it can hold, then I would assume the answer is no, and that the routine will just take an additional round [or more] to get to everything, because some Blocks will be omitted with each round until the number falls within the allowable limit. Others may have experience with pushing things to numerical limits like that.
Yeah the archietct we use has a strange way of drawing i guess.. haha
Though i could only assume that this is the cause of the lisp routine failing - just opening the file there is 9000 objects in the drawing upon running a burst all on the drawing in properties after selecting all entities there is "No Selection" so i'd guess after first burst of objects it has pushed passed the maximum limit AutoCAD allows for a selection hence then making the routine fail. I'll have to look around to see if there is a way to set a maximum amount of objects selected using SSGET.
I investigated into each section of the drawing seems there is a non exploadable Block Reference - so the routine is obviously finding 1 block and because it cannot burst its just stuck on a constant loop.
The block has no block reference though.. even if pasted into a new drawing it cannot be edited.
Yes that is the idea because it is forcing the Burstzero routine to be stuck in a forever loop as there is 1 block still found that cannot be bursted.
I have attached the object from within the architectural that i cannot seem to find a way to burst.
I run this routine before running the Burstzero routine to stop "non-exploadable" blocks from making the lisp routine freeze.
(defun c:eb () (vlax-map-collection (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)) ) '(lambda (x) (and (vlax-property-available-p x 'explodable) (eq (vlax-get-property x 'explodable) :vlax-false) (not (vlax-put-property x 'explodable :vlax-true)) ) ) ) )
Hang-on i'll try to look for the recursive code i posted for exploding blocks.......
One question though. the sample you posted doesnt have attributes? do you need to explode that block as well?
Yeah attributes or not its just part of the cleaning routine of the archtectural files because every thing eventually gets turned to colour 8 for inserting as a underlay to our electrical drawings. And because the script for batching the drawings calls for the overall lisp routine burstzero is run and it puts a hold on the script process because it is stuck in a constant loop of trying to burst that 1 block remaining in the drawing.
Explode all the Nested Blocks:
<Exclusively Model Space>
(Defun c:ExAll ( / _ExplodeBlocks aDoc lst Blkcoll bn ) ;;; pBe 13Mar2013 ;;; (vl-load-com) (defun _ExplodeBlocks (bname BC) (if (not (member bname lst)) (progn (setq lst (cons bname lst) obj (vla-item BC bname)) (if (eq (vla-get-Explodable obj) :vlax-false) (vla-put-Explodable obj :vlax-true)) (vlax-for itm obj (if (eq "AcDbBlockReference" (vla-get-objectname itm)) (progn (setq bn (vla-get-name itm)) (vla-explode itm) (vla-delete itm) (_ExplodeBlocks bn BC) ))))) ) (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq lst nil ss (ssadd) Blkcoll (vla-get-blocks aDoc)) (vlax-for itm Blkcoll (setq a (cons itm a))) (vlax-for itm Blkcoll (cond ((and (eq :vlax-false (vla-get-islayout itm)) (eq :vlax-false (vla-get-IsXref itm)) (not (wcmatch (setq bn (vla-get-name itm)) "`*D*")) (_ExplodeBlocks (Vla-get-name itm) Blkcoll) )))) ;(vlax-for layout (vla-item (vla-get-layouts aDoc) "Model") (vlax-for i (vla-get-block (vla-item (vla-get-layouts aDoc) "Model")) (if (and (eq (vla-get-objectname i) "AcDbBlockReference") (not (vlax-property-available-p i 'path))) (if (eq (Vla-get-hasAttributes i) :Vlax-true) (ssadd (vlax-vla-object->ename i) ss) (progn (vlax-invoke i 'Explode) (vla-delete i))) ) ) ;) (if (> (sslength ss) 0) (progn (sssetfirst nil ss) (c:burst) )) (vla-regen aDoc acActiveViewport) )
EDIT: misplaced cond.
Thanks once again pbejse
Just quickly i am guessing this routine is only bursting objects and not actually exploading it using the "explode" command, also just want to clarify what exactly this routine is doing 🙂
Is it sifting through all blocks in the drawing in model space and then going through and bursting everything out even that non exploadable block (it worked really well on that drawing). I guess what i am asking is will it burst all blocks till there is no more found and what about xrefs that are attached to the drawing will that cause any problems??
@mwhea wrote:Thanks once again pbejse
Just quickly i am guessing this routine is only bursting objects and not actually exploading it using the "explode" command, also just want to clarify what exactly this routine is doing 🙂
Is it sifting through all blocks in the drawing in model space and then going through and bursting everything out even that non exploadable block (it worked really well on that drawing). I guess what i am asking is will it burst all blocks till there is no more found and what about xrefs that are attached to the drawing will that cause any problems??
Burst for attribute blocks in one go and use VL explode method for the rest.
Yes, only on model space [guess you need to add (setvar 'ctab "Model") on the start of the rouitne as Kent suggested otherwise (foreach lay (cons "Model" (layoutlist))....) <the burst command limitation is the object needs to be on the current layout>
non-explodable blocks are dealt with prior to object selection via block collection. [exploadable flag and explode]. whcih means there is no need to repeat burst as it ensures all nested blocks are already exploded. [unless the nested ones include attributes as well then we may need to write our own version of "Burst"
Xrefs are excluded, unless you want to bind them first and be treated as regular blocks.
HTH