Burst all blocks in a drawing (without selection set)

Burst all blocks in a drawing (without selection set)

sam_safinia
Advocate Advocate
3,540 Views
13 Replies
Message 1 of 14

Burst all blocks in a drawing (without selection set)

sam_safinia
Advocate
Advocate

I am using this super lisp By Lee Mac for a while (thanks you exist Lee!) but wondering how it can be rectify in a way that it burst every single blocks in a drawing and with no selection window(set). How can put all existing blocks in its list? Thanks

0 Likes
3,541 Views
13 Replies
Replies (13)
Message 2 of 14

hmsilva
Mentor
Mentor

Hi s_plant,

 

ensures that 'BurstUpgradedV1-2.lsp' is loaded, and something like this should do the trick

 

(defun c:demo (/ ss )
   (if (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1))))
      (LM:burst ss)
      )
   (princ)
   )

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 14

sam_safinia
Advocate
Advocate

Henrique,

 

You rock!

 

Is there any way to combine both lisps into one rather than to load them separately? Thanks

0 Likes
Message 4 of 14

hmsilva
Mentor
Mentor

@s_plant wrote:

Is there any way to combine both lisps into one rather than to load them separately? Thanks


You're welcome, s_plant
add the 'demo' function at the end of the main code...

Henrique

EESignature

0 Likes
Message 5 of 14

sam_safinia
Advocate
Advocate

i added but the main lisp does not function properly as before. It only burst some of the blocks!! I have not checked properly before but even with previous method I got same result as partially bursting.

0 Likes
Message 6 of 14

hmsilva
Mentor
Mentor

@s_plant wrote:

i added but the main lisp does not function properly as before. It only burst some of the blocks!! I have not checked properly before but even with previous method I got same result as partially bursting.


I'm confused...

 

Let's recap, if you add the 'demo' function, after the Lee Mac's BurstUpgradedV1-2.LSP end, after 'End of File ', you'll have the original 'iburst' command, and the 'demo' command.

 If you type 'iburst' the code will ask to select blocks, if you type 'demo' no selection will be asked, and all blocks with attributes will be burst...

 

Henrique

EESignature

0 Likes
Message 7 of 14

sam_safinia
Advocate
Advocate

Yes, That's correct. Please find attached files o sample drawing and modified lisp.

0 Likes
Message 8 of 14

hmsilva
Mentor
Mentor

Hi s_plant,

 

just remove the (66 . 1) from the 'demo' function, It should work as expected.

 

Henrique

EESignature

0 Likes
Message 9 of 14

sam_safinia
Advocate
Advocate

Thanks Henrique. Work Perfectly

0 Likes
Message 10 of 14

hmsilva
Mentor
Mentor

@s_plant wrote:

Thanks Henrique. Work Perfectly


You're welcome, s_plant!

Henrique

EESignature

0 Likes
Message 11 of 14

sam_safinia
Advocate
Advocate

I tested the original lisp (same result with lisp without  selection prompt) and it will burst all block within my drawing after 4th attempts! It means that I need to run the lisp few times to get the job done. Is there any way to run any lisp several times?

 

(defun c:demo (/ ss )
   (if (setq ss (ssget "_X" '((0 . "INSERT") )))
      (LM:burst ss)
      ;; Here I need looping back to the top and re-running
      )
   (princ)
   )

Thanks

0 Likes
Message 12 of 14

hmsilva
Mentor
Mentor

@s_plant wrote:

I tested the original lisp (same result with lisp without  selection prompt) and it will burst all block within my drawing after 4th attempts! It means that I need to run the lisp few times to get the job done. Is there any way to run any lisp several times?

 

(defun c:demo (/ ss )
   (if (setq ss (ssget "_X" '((0 . "INSERT") )))
      (LM:burst ss)
      ;; Here I need looping back to the top and re-running
      )
   (princ)
   )

 


Hi s_plant,

the 'repeat' function...

We could use the 'while' function, but if they exist non-uniformly scaled blocks or xrefs, the the loop would be endless...

 

(defun c:demo (/ ss)
   (repeat 4
      (if (setq ss (ssget "_X" '((0 . "INSERT"))))
         (LM:burst ss)
      )
   )
   (princ)
)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 13 of 14

Anonymous
Not applicable

This doesn't work anymore with Lee's latest script. Its version 1.7

 

@hmsilva Do you think you can update your script to work with Lee's latest script?

 

 

0 Likes
Message 14 of 14

dlanorh
Advisor
Advisor

It was designed to work with the attached.

I am not one of the robots you're looking for

0 Likes