Author Topic: Explode unexploded blocks  (Read 5412 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Explode unexploded blocks
« 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..
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Explode unexploded blocks
« Reply #1 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

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Explode unexploded blocks
« Reply #2 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")))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Explode unexploded blocks
« Reply #3 on: September 07, 2011, 03:42:21 PM »
And you can also use QSELECT to select all blocks then..... KA-BOOOOOMMM!!!!!
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Explode unexploded blocks
« Reply #4 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
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Explode unexploded blocks
« Reply #5 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.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Explode unexploded blocks
« Reply #6 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.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Explode unexploded blocks
« Reply #7 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.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Explode unexploded blocks
« Reply #8 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.

Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Explode unexploded blocks
« Reply #9 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.  :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

vnanhvu

  • Guest
Re: Explode unexploded blocks
« Reply #10 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 !

kruuger

  • Swamp Rat
  • Posts: 637
Re: Explode unexploded blocks
« Reply #11 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.