Author Topic: Thoughts on a better ERASE command  (Read 7060 times)

0 Members and 1 Guest are viewing this topic.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Thoughts on a better ERASE command
« Reply #15 on: June 19, 2012, 10:53:03 AM »
Or work similar to a normal Trash-Bin. I.e. have a setting to specify a maximum amount of entities to keep (could be as a percentage of the entire DWG). That way only keep the latest entities and delete the older ones - it should be sorted by time of deletion in any case (if you simply keep adding them to the block def).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

danallen

  • Guest
Re: Thoughts on a better ERASE command
« Reply #16 on: June 19, 2012, 12:49:08 PM »

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Thoughts on a better ERASE command
« Reply #17 on: June 19, 2012, 02:18:57 PM »
Another maybe great idea for a better erase command is to put elements in a recycle bin or something like that. If you open that drawing recycle bin, you see a drawing with everything you've erased and the possibility to restore the element.

You could always "send" the erased objects to a non-referenced block definition inside the DWG.

That's a great idea Irné!  8-)

Attached is my first draft of a possible program which implements this proposed method to give us all something to work with.

The 'recycle' command will move a selection of objects to the 'drawing recycle bin', and the 'restore' command will restore objects that were previously recycled. The recycle bin can be 'emptied' by simply purging the block collection.

Feel free to add comments and suggestions  :-)
« Last Edit: June 19, 2012, 02:25:00 PM by Lee Mac »

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: Thoughts on a better ERASE command
« Reply #18 on: June 19, 2012, 04:43:34 PM »
It is really great Lee Mac!  8) Great to see ideas come to life!

Maybe, if it is not asked too much, a preview of the selected restore item? In big red lines? :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Thoughts on a better ERASE command
« Reply #19 on: June 19, 2012, 04:51:09 PM »
It is really great Lee Mac!  8) Great to see ideas come to life!

Thank you huiz  :-)

Maybe, if it is not asked too much, a preview of the selected restore item? In big red lines? :-)

This would certainly be possible by inserting the 'recycled' block into the drawing and perhaps drawing a box around it using grvecs / grdraw to make it easily distinguishable from surrounding objects, but since standard DCL only permits modal dialogs, the dialog would need to be suppressed and then reloaded if the user cancels the preview (similar to the preview option of the Array command).

ScottMC

  • Newt
  • Posts: 191
Re: Thoughts on a better ERASE command
« Reply #20 on: August 03, 2020, 11:56:26 PM »
Actually better than cut with basepoint as it allows both, multiple separate erased and saved with file! Anyway the restore could ask/allow an alternate or original point/location to restore to?

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Thoughts on a better ERASE command
« Reply #21 on: August 05, 2020, 02:07:41 PM »
Actually better than cut with basepoint as it allows both, multiple separate erased and saved with file! Anyway the restore could ask/allow an alternate or original point/location to restore to?

Yes - change this:
Code - Auto/Visual Lisp: [Select]
  1.                 (foreach bn (LM:ListBox "Select Items to Restore" (vl-sort lst '>) t)
  2.                     (setq bo (vlax-invoke as 'insertblock '(0.0 0.0 0.0) bn 1.0 1.0 1.0 0.0))
  3.                     (vla-explode bo)
  4.                     (vla-delete  bo)
  5.                     (vl-catch-all-apply 'vla-delete (list (vla-item bc bn)))
  6.                 )

To:
Code - Auto/Visual Lisp: [Select]
  1.                 (foreach bn (LM:ListBox "Select Items to Restore" (vl-sort lst '>) t)
  2.                     (if (setq ip (getpoint "\nSpecify insertion point: "))
  3.                         (progn
  4.                             (setq bo (vlax-invoke as 'insertblock (trans ip 1 0) bn 1.0 1.0 1.0 0.0))
  5.                             (vla-explode bo)
  6.                             (vla-delete  bo)
  7.                             (vl-catch-all-apply 'vla-delete (list (vla-item bc bn)))
  8.                         )
  9.                     )
  10.                 )

Note that the base point is always relative to the drawing origin however.

ScottMC

  • Newt
  • Posts: 191
Re: Thoughts on a better ERASE command
« Reply #22 on: May 03, 2021, 05:49:01 PM »
Lee.. anyway you could help me rework this to acquire the insert cut point upon picking object(s) instead of the (0.0 0.0 0.0) as in your "DrawingRecycleBin" Please?  :idea:

                    (vla-get-blocks ad)
                   'add
                    '(0.0 0.0 0.0) << would help! Wish to understand how to get
                                               a coord (getpoint..) to work.
      Thanks so much!
« Last Edit: May 04, 2021, 06:57:43 PM by ScottMC »

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Thoughts on a better ERASE command
« Reply #23 on: May 11, 2021, 06:50:55 PM »
Wow, I get engrossed in doing what I need to fix up and this is what I come back to find! There is some incredible stuff here.