TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on September 07, 2011, 03:07:34 PM

Title: Explode unexploded blocks
Post by: Andrea on September 07, 2011, 03:07:34 PM
Code: [Select]
(defun c:kaboum (/ it)
(setq it (vlax-ename->vla-object (car (entsel))))
(vlax-safearray->list (variant-value (vlax-invoke-method it "Explode")))
(vla-delete it)
)

just sharing..
Title: Re: Explode unexploded blocks
Post by: Lee Mac on September 07, 2011, 03:09:57 PM
Sorry to criticise Andrea, but this doesn't seem like your usual standard of coding... variable 'it' isn't defined, and no error trapping should the user miss...

EDIT: I see you fixed 'it' :P
Title: Re: Explode unexploded blocks
Post by: ronjonp on September 07, 2011, 03:16:16 PM
Also you could shorten a bit.  :-)

(vlax-invoke it 'Explode)

returns the same as this:

(vlax-safearray->list (variant-value (vlax-invoke-method it "Explode")))
Title: Re: Explode unexploded blocks
Post by: Matt__W on September 07, 2011, 03:42:21 PM
And you can also use QSELECT to select all blocks then..... KA-BOOOOOMMM!!!!!
Title: Re: Explode unexploded blocks
Post by: alanjt on September 07, 2011, 03:44:01 PM
And you can also use QSELECT to select all blocks then..... KA-BOOOOOMMM!!!!!
Yeah, the routine.  :-D
Title: Re: Explode unexploded blocks
Post by: Matt__W on September 07, 2011, 03:45:13 PM
And you can also use QSELECT to select all blocks then..... KA-BOOOOOMMM!!!!!
Yeah, the routine.  :-D
Just t'rowin' out anudder option, dat's all.
Title: Re: Explode unexploded blocks
Post by: alanjt on September 07, 2011, 03:48:09 PM
And you can also use QSELECT to select all blocks then..... KA-BOOOOOMMM!!!!!
Yeah, the routine.  :-D
Just t'rowin' out anudder option, dat's all.
Just trollin.
Title: Re: Explode unexploded blocks
Post by: Matt__W on September 07, 2011, 03:57:07 PM
And you can also use QSELECT to select all blocks then..... KA-BOOOOOMMM!!!!!
Yeah, the routine.  :-D
Just t'rowin' out anudder option, dat's all.
Just trollin.
Title: Re: Explode unexploded blocks
Post by: Andrea on September 08, 2011, 10:15:10 AM
Thank you Ronjonp for the shorter way. :)

Lee, I was typing during talking on phone...I was distracted. :P

Have a nice one guys.

Title: Re: Explode unexploded blocks
Post by: ronjonp on September 08, 2011, 10:36:36 AM
Thank you Ronjonp for the shorter way. :)

Lee, I was typing during talking on phone...I was distracted. :P

Have a nice one guys.

No prob ... although thinking about it more it does not really matter what is returned since it's not being fed to anything.  :-)
Title: Re: Explode unexploded blocks
Post by: vnanhvu on September 09, 2011, 11:41:14 PM
 Hi all !
Can you help me covert Unexplode Blocks to Allow exploding Blocks and reverse.
Thanks all !
Title: Re: Explode unexploded blocks
Post by: kruuger on September 10, 2011, 01:30:15 AM
Hi all !
Can you help me covert Unexplode Blocks to Allow exploding Blocks and reverse.
Thanks all !
try this
http://www.theswamp.org/index.php?topic=38488.msg436115#msg436115
inside is routine to do this BX
k.