Jump to content

Dont snap to Locked Stuff! / Lock a block or Object!


TimZilla

Recommended Posts

Two questions!

 

 

First: Is there a way to set up your osnaps so that they do not snap on on stuff that is locked?

 

Second: Is there a way to lock a block or object without locking the whole layer?

 

 

 

 

If I could figure both of these things out I would save a lot of time.

 

Sometimes I just have way to much stuff in my drawing, most of it is for reference and I never need to snap to it, I need to see it, but I hate that it picks up my snaps. Drives me crazy.!

Link to comment
Share on other sites

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

  • TimZilla

    18

  • alanjt

    16

  • ReMark

    6

  • Lee Mac

    5

Top Posters In This Topic

I think this is in the wrong section.. Though it DOES say customization..

 

However, just in-case it helps any.. the Osnaps automatically "prefer" the current drawing layer. Perhaps that's enough?

 

Otherwise, you can fine tune the selection process by adjusting the size of the selection box in your Drafting settings (in options).. I'm not sure of any settings that do what you're asking, but I'm on older cad, so who knows.

Link to comment
Share on other sites

I think this is in the wrong section.. Though it DOES say customization..

 

However, just in-case it helps any.. the Osnaps automatically "prefer" the current drawing layer. Perhaps that's enough?

 

Otherwise, you can fine tune the selection process by adjusting the size of the selection box in your Drafting settings (in options).. I'm not sure of any settings that do what you're asking, but I'm on older cad, so who knows.

 

 

yeah, i tried adjusting the size, didn't work for me. I am hoping that some genius develops a lisp command just for me and I can say, YAAAY!, thank youz!

 

 

how about locking an object, instead of a layer?

Link to comment
Share on other sites

Am I the only one this would help? It has to exist.

 

the osnaps prefer current wouldnt help, but it would help if it just didnt snap to stuff thats locked.

 

I put all of my walls and doors in one layer/one color.

HVAC/Mechanical in one layer/one color.

Electrical in one layer/one color.

Ceiling Grid in one layer/one color

 

and so on.

 

Then, I lock most of it and it makes it faded. So that when I draw my stuff, being the Sprinkler System. My stuff stands out. If I could only figure a way to keep my osnaps from jumping to certain things, although not everything. Just wish I had an option to pick. Even an option to keep osnaps from sticking to certain layers would be cool, if the locked layer thing wouldnt work. Something.

Link to comment
Share on other sites

This is the best I can think of for the moment - but its a bit risky :(

 

(defun c:VisTog ( / tmp )
 ;; Lee Mac  ~  27.04.10
 
 (if (or (and *ss* (not (setq tmp *ss* *ss* nil)))
         (and (setq tmp (ssget)) (setq *ss* tmp)))
   
   ( (lambda ( i / e )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (Update
           (PutDXF 60
             (- 1 (cond ((cdr (assoc 60 (entget e)))) (0)))
             (entget e)
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

(defun PutDXF ( code value elist )
 (entmod
   (if (assoc code elist)
     (subst (cons code value) (assoc code elist) elist)
     (append elist (list (cons code value)))
   )
 )
)

(defun Update ( elist )
 (entupd (cdr (assoc -1 elist)))
)

Link to comment
Share on other sites

So, I should probably do my testing at home and not at work ehh? can't afford to lose a days work by messing anything up.

 

also, thanks for the "double no"

 

I would be willing to bet it can be done. Anything can be done in autoCAD. It seems like every time I have an idea, somebody has already created something for it. I love AutoCAD. I am such a nerd. But I just love it.

Link to comment
Share on other sites

A lot of the vertical versions of AutoCAD has the object isolate/hide option built in. Actually, I think newer version of ACAD have added this to the core.

It's not really 'locking' individual objects though.

 

This is the best I can think of for the moment - but its a bit risky :(

 

(defun c:VisTog ( / tmp )
 ;; Lee Mac  ~  27.04.10
 
 (if (or (and *ss* (not (setq tmp *ss* *ss* nil)))
         (and (setq tmp (ssget)) (setq *ss* tmp)))
   
   ( (lambda ( i / e )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (Update
           (PutDXF 60
             (- 1 (cond ((cdr (assoc 60 (entget e)))) (0)))
             (entget e)
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

(defun PutDXF ( code value elist )
 (entmod
   (if (assoc code elist)
     (subst (cons code value) (assoc code elist) elist)
     (append elist (list (cons code value)))
   )
 )
)

(defun Update ( elist )
 (entupd (cdr (assoc -1 elist)))
)

Link to comment
Share on other sites

My code won't damage your drawings at all, it just switches Object Visibility, but its risky in the fact that some people may not know how to switch back on Object Visibility if it goes wrong.

 

This function will make everything visible again :)

 

(defun c:AllVis ( / tmp )
 ;; Lee Mac  ~  27.04.10
 
 (if (setq tmp (ssget "_X"))
   
   ( (lambda ( i / e )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (Update
           (PutDXF 60 0 (entget e))
         )
       )
     )
     -1
   )
 )

 (princ)
)

(defun PutDXF ( code value elist )
 (entmod
   (if (assoc code elist)
     (subst (cons code value) (assoc code elist) elist)
     (append elist (list (cons code value)))
   )
 )
)

(defun Update ( elist )
 (entupd (cdr (assoc -1 elist)))

 

Lee

Link to comment
Share on other sites

So, I should probably do my testing at home and not at work ehh? can't afford to lose a days work by messing anything up.

 

also, thanks for the "double no"

 

I would be willing to bet it can be done. Anything can be done in autoCAD. It seems like every time I have an idea, somebody has already created something for it. I love AutoCAD. I am such a nerd. But I just love it.

My response wasn't meant to be smarmy. I'm honestly telling you that it can't be done. What Lee provided will HIDE an object, not 'lock' it. What you are asking goes against the basic structuring of AutoCAD.

 

The only way you are going to achieve this is to put an object reactor on it, but that is beyond insane.

Link to comment
Share on other sites

My code won't damage your drawings at all, it just switches Object Visibility, but its risky in the fact that some people may not know how to switch back on Object Visibility if it goes wrong.

 

This function will make everything visible again :)

And what happens when a person opens this drawing and doesn't have a way to make all objects visible or know that such a thing is possible?

Link to comment
Share on other sites

Hide Objects (AutoCAD 2010)

 

Temporarily hides selected objects for the current drawing session.

 

There is also an Isolate Ojects command. Notice there is no mention of locking objects so they cannot be selected.

Link to comment
Share on other sites

Fair point Alan, as I said, it was risky.

 

And I didn't know about those ReMark, but just for completeness, these are probably better than a toggle:

 

(defun c:AllVis ( / tmp )
 ;; Lee Mac  ~  27.04.10
 
 (if (setq tmp (ssget "_X"))
   
   ( (lambda ( i / e )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (Update
           (PutDXF 60 0 (entget e))
         )
       )
     )
     -1
   )
 )

 (princ)
)

(defun c:Invis ( / tmp )
 ;; Lee Mac  ~  27.04.10

 (if (setq tmp (ssget "_:L"))

   ( (lambda ( i / e )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (Update
           (PutDXF 60 1 (entget e))
         )
       )
     )
     -1
   )
 )

 (princ)
)

(defun PutDXF ( code value elist )
 (entmod
   (if (assoc code elist)
     (subst (cons code value) (assoc code elist) elist)
     (append elist (list (cons code value)))
   )
 )
)

(defun Update ( elist )
 (entupd (cdr (assoc -1 elist)))
)

 

But I prefer your solutions.

Link to comment
Share on other sites

Hide Objects (AutoCAD 2010)

 

Temporarily hides selected objects for the current drawing session.

 

There is also an Isolate Ojects command. Notice there is no mention of locking objects so they cannot be selected.

Thank you.

Link to comment
Share on other sites

Fair point Alan, as I said, it was risky.

I know, but sometimes I think you are too quick to post a possible solution of code. When something is considered risky, perhaps it's better left alone.

Link to comment
Share on other sites

Well, Fire Sprinkler Designers make up about .00001 % of the CAD world, so I understand there is not a lot of stuff built for us. We have to follow our codes while working around other peoples crap. Very difficult. We get that left over space to work in, yet perfection is expected. Thats why you will notice I ask some pretty weird stuff. 98% of the time you people are very helpfull, and I usually make toolbar buttons out of the lisp's I get here. I have a lot of good stuff that speeds my day up.

 

 

.....waiting for the "what do you mean "YOU PEOPLE" comment"

Link to comment
Share on other sites

Could you turn off your sprinkler stuff do a JPGOUT to create a JPG of the background. Insert the JPG and verify location and scale, then freeze off everything except your jpg and your sprinkler layer.

 

When you're done, detach the jpg and thaw the structure and you are back to where you want to be.

 

Glen

Link to comment
Share on other sites

Could you turn off your sprinkler stuff do a JPGOUT to create a JPG of the background. Insert the JPG and verify location and scale, then freeze off everything except your jpg and your sprinkler layer.

 

When you're done, detach the jpg and thaw the structure and you are back to where you want to be.

 

Glen

 

 

turns into a big blob.

 

big+blob.jpg

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