TimZilla Posted April 27, 2010 Share Posted April 27, 2010 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.! Quote Link to comment Share on other sites More sharing options...
MikeScott Posted April 27, 2010 Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
TimZilla Posted April 27, 2010 Author Share Posted April 27, 2010 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? Quote Link to comment Share on other sites More sharing options...
TimZilla Posted April 27, 2010 Author Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2010 Share Posted April 27, 2010 I'm going to go out on a limb and respond with a double No. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 27, 2010 Share Posted April 27, 2010 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))) ) Quote Link to comment Share on other sites More sharing options...
TimZilla Posted April 27, 2010 Author Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2010 Share Posted April 27, 2010 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))) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 27, 2010 Share Posted April 27, 2010 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 Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2010 Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 27, 2010 Share Posted April 27, 2010 It's not really 'locking' individual objects though. Not really, but they can't be snapped to, and it was the best I could think of Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2010 Share Posted April 27, 2010 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? Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 27, 2010 Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 27, 2010 Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2010 Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2010 Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
TimZilla Posted April 27, 2010 Author Share Posted April 27, 2010 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" Quote Link to comment Share on other sites More sharing options...
TimZilla Posted April 27, 2010 Author Share Posted April 27, 2010 Well, how about an osnap lisp, that prevents it to stick to certain layers? I could make that work. Quote Link to comment Share on other sites More sharing options...
Glen Smith Posted April 27, 2010 Share Posted April 27, 2010 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 Quote Link to comment Share on other sites More sharing options...
TimZilla Posted April 27, 2010 Author Share Posted April 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.