Results 1 to 4 of 4

Thread: How can I stop an object from being erased from a drawing

  1. #1
    Member
    Join Date
    2004-05
    Posts
    27
    Login to Give a bone
    0

    Lightbulb How can I stop an object from being erased from a drawing

    Hello all,

    How can I stop an object from being erased from a drawing? The code I have developed checks to see if the object is on a protected layer and if so it simply undoes the erase command. Is this OK or is there a better way.

    Mike

  2. #2
    Active Member
    Join Date
    2002-05
    Posts
    72
    Login to Give a bone
    0

    Default Re: How can I stop an object from being erased from a drawing

    I did a something to achieve the same result but totally different method some time ago. Created a layer XYZ_Lock and placed the protected items on this layer. Then had the code lock the layer and monitor if it got unlocked to relock it immediately, and if it got set current to change 0 to be current, this was to prevent users from adding object to the layer by accident. Soon users found away around it by renaming the layer, so instead of identifying the layer by name I changed to code to use its handle. Since then no problems.

  3. #3
    100 Club lance.81922's Avatar
    Join Date
    2005-01
    Location
    Santa Fe, NM
    Posts
    176
    Login to Give a bone
    0

    Default Re: How can I stop an object from being erased from a drawing

    What about creating a series of reactors? I did something similar with OFFSET, so that any time I OFFSET an object it would be placed on the current layer. One reactor watches to see if the OFFSET command has started, a second watches for new objects being added to the database, and the third updates the object. In your case you could come up with an object reactor that notices when the object is being deleted.

  4. #4
    Member
    Join Date
    2000-11
    Location
    Atlanta, GA
    Posts
    48
    Login to Give a bone
    0

    Default Re: How can I stop an object from being erased from a drawing

    Why not attach XData to the object? Then when the erase command is initiated check to see if the XData matches and if so, remove it from the selection set.

Similar Threads

  1. Replies: 2
    Last Post: 2013-08-20, 04:31 PM
  2. Object was erased
    By avinash patil in forum VBA/COM Interop
    Replies: 3
    Last Post: 2012-09-17, 08:52 AM
  3. Replies: 5
    Last Post: 2012-01-31, 08:49 AM
  4. Replies: 2
    Last Post: 2011-04-07, 07:06 PM
  5. Prompt to detach xref if erased from drawing
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2006-02-14, 05:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •