Jump to content

Recommended Posts

Posted (edited)

Is it possible to stick an entity in a dwg without being able to get rid of it?

 

Thanks

Edited by Sweety
extra letter
  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Sweety

    5

  • ReMark

    4

  • Lee Mac

    4

  • David Bethel

    3

Top Posters In This Topic

Posted

You want to put something in a drawing and prohibit the user from deleting it?

 

What is this mysterious "entity"?

Posted

The paperspace viewport is the only thing that comes to mind. -David

Posted

Thanks guys.

 

I mean any entity in general Text,Line,Circle....

Posted

Paper space viewports can be deleted can't they?

Posted
Paper space viewports can be deleted can't they?

 

Yes of course,

 

If you turn off the layer that it's belond to, you can not select it to delete it.

 

But viewport not my question .

 

Thanks

Posted

Something like the Education Stamp?

 

Since you're not really explaining what you are wanting with this, I'll assume that you want to protect your DWGs in some way - to that I say, only send drawings as PDFs.

Posted

Using just the command line:

 

Enter template file name or [. (for none)] :.

Regenerating model.

 

Command: tm

TILEMODE

Enter new value for TILEMODE : 0

Regenerating layout.

Regenerating model.

 

Command: e

ERASE

Select objects: all

2 found

1 was the paper space viewport.

 

Select objects:

 

Command: e

ERASE

Select objects: all

1 found

1 was the paper space viewport.

 

Select objects:

 

---

 

Starting in A2K, you can however select all layout tabs and the right click and delete the paperspace viewport. -David

Posted

What's the purpose? Is it just to prevent users from deleting or changing content?

Posted
What's the purpose? Is it just to prevent users from deleting or changing content?

 

exactly dear remark. :thumbsup:

 

That's what I am looking for.

Posted

If a human can conceive of the idea another human can find a way around it.

 

The only entities I've seen in a drawing that, to me anyway, are impossible to get rid of are geomarkers.

Posted
exactly dear remark. :thumbsup:

 

That's what I am looking for.

 

Again; PDF.

Posted
Again; PDF.

 

Dear Tiger, PDF would save the whole dwg, and I am talking about one object in a dwg.

Posted

Off topic:

paerspace itself is a viewport.

 

@David

using lisp: layer zero too. :) I knew a guy who deleted layer zero--with VB i think--on a production drawing once. *lol*

 

On topic:

Maybe make it invisible (there is a visibility property)? But i dont think this is what you are looking for.

Posted

@David

using lisp: layer zero too. :) I knew a guy who deleted layer zero--with VB i think--on a production drawing once. *lol*

 

OMG! I had never heard of that! -David

Posted

It can be done through the use of a reactor, but this will only persist throughout the session:

 

(defun c:LockObjects ( / ss )
 (vl-load-com)
 ;; © Lee Mac 2010
 
 (if (setq ss (ssget))
   (
     (lambda ( i / e hand )
       (while (setq e (ssname ss (setq i (1+ i))))
         (if
           (not
             (vl-position
               (setq hand
                 (vla-get-Handle (vlax-ename->vla-object e))
               )
               *locked*
             )
           )
           (setq *locked* (cons hand *locked*))
         )
       )
       (if
         (not
           (vl-some
             (function
               (lambda ( reactor )
                 (eq "ObjectLock" (vlr-data reactor))
               )
             )
             (cdar (vlr-reactors :vlr-editor-reactor))
           )
         )
         (vlr-editor-reactor "ObjectLock"
           (list
             (cons :vlr-commandEnded 'ObjectLockCallBack)
           )
         )
       )
     )
     -1
   )
 )
 (princ)
)

(defun c:UnLockObjects ( / ss )
 (vl-load-com)
 ;; © Lee Mac 2010

 (if *locked*
   
   (if (setq ss (ssget))
     (
       (lambda ( i / e hand )
         (while (setq e (ssname ss (setq i (1+ i))))
           (if (vl-position
                 (setq hand
                   (vla-get-Handle (vlax-ename->vla-object e))
                 )
                 *locked*
               )
             (setq *locked* (vl-remove hand *locked*))
           )
         )
       )
       -1
     )
   )
   (princ "\n** No Objects Locked **")
 )

 (princ)
)

(defun c:DisableLock ( / reactor )
 (vl-load-com)
 ;; © Lee Mac 2010
 
 (if
   (setq reactor
     (vl-some
       (function
         (lambda ( reactor )
           (if (eq "ObjectLock" (vlr-data reactor)) reactor)
         )
       )
       (cdar (vlr-reactors :vlr-editor-reactor))
     )
   )
   (vlr-remove reactor)
   (princ "\n** Object Lock not Running **")
 )

 (princ)
)

(defun ObjectLockCallBack ( reactor arguments )
 
 (if (wcmatch (strcase (car arguments)) "ERASE,EXPLODE")
   (mapcar
     (function
       (lambda ( handle )
         (or (entget (handent handle)) (entdel (handent handle)))
       )
     )
     *locked*
   )
 )
 (princ)
)

Posted

I know this sounds crazy, but you could just educate users to NOT delete something if on a locked or specific layer.

Posted
I know this sounds crazy, but you could just educate users to NOT delete something if on a locked or specific layer.

 

lol that would be too simple Alan :wink:

Posted
...clearly...

 

Still, it doesn't hurt to demonstrate what one can do if one wanted to.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...