Author Topic: Delete Block Table entity  (Read 6798 times)

0 Members and 1 Guest are viewing this topic.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Delete Block Table entity
« Reply #15 on: April 26, 2011, 04:03:17 PM »
  • Doesn't account for anonymous Dynamic Block names
  • Doesn't account for Blocks on Locked Layers
  • Doesn't account for nested blocks
It doesn't do much, does it??  It's kinda like the free-loading-college-buddy of LSP routines.  :wink:
It just hangs around and smokes all your pot.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

cadman6735

  • Guest
Re: Delete Block Table entity
« Reply #16 on: April 26, 2011, 05:13:19 PM »
Quote
It doesn't do much, does it??  It's kinda like the free-loading-college-buddy of LSP routines
Cold man, Cold...    I was pleased with my accomplishment, thanks for shattering my ego...  :-) just kidding

Very cool

Thanks for the feed back, this is what I need...

« Last Edit: April 26, 2011, 06:17:10 PM by cadman6735 »

cadman6735

  • Guest
Re: Delete Block Table entity
« Reply #17 on: April 27, 2011, 09:22:08 AM »
Hi Lee

Thanks for the code and advice.
Quote
Since you needn't try to delete the block definition until all the INSERTs have been deleted.

What's wrong with the way I am attmepting to do it?
Code: [Select]
(entdel ent)
(vl-catch-all-apply 'vla-delete (list (vlax-ename->vla-object (cdr (assoc 330 (entget entTblName))))))
I first delete the INSERT then (attempt) to delete the block definition one at a time vs deleting all INSERTS then deleting all definitions.  I am going a sequence (entdel) then (vla-delete).
Why is one way better than another?

(I say attempt because it only deletes a block defintion with the exact name "seal" not all the block definisions in the sset.)

It should delete anything caught by the sset, right?

Thanks for all your help.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Delete Block Table entity
« Reply #18 on: April 27, 2011, 09:25:39 AM »
If you have a thousand blocks the table entry delete will not work until all the blocks are removed. It would most likely be faster to delete all the blocks first then only call the table delete once rather than 1000 times.

Make sense?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cadman6735

  • Guest
Re: Delete Block Table entity
« Reply #19 on: April 27, 2011, 09:51:37 AM »
Hi Ron

Yes, this makes sense.

So if I have 10 blocks of the same definition.  my code will delete one block at a time, so on the first pass I have only deleted one instance of the block leaving 9 behind so it is attempting to delete a definition that can't be deleted because there are still 9 left, right?  But on deleting the last INSERT it should delete the definition right? but this wastes time and probably has a chance to error too.  (I am only guessing about the error part)

Am I on the right track?
Thanks

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Delete Block Table entity
« Reply #20 on: April 27, 2011, 09:54:33 AM »
Exactamundo!  :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC