Jump to content

Stick entity in a dwg


Sweety

Recommended Posts

  • 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

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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)
)

Link to comment
Share on other sites

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...