Dj_T_Rex2002 Posted December 22, 2015 Posted December 22, 2015 Hello, I have been searching in the threads to see if I could find what I need but haven't. (Just in case: I found a really nice LISP that helps to turn off XRef layers in Vport (see code below in case anyone needs it. Not sure if I found it here or a different site)) ... I would like to know if there is a LISP to turn off XRef layers in Model Tab ? Thanks in advance. (defun c:XX () (c:VPFreezeXref)) (defun c:VPFreezeXref (/ ss oBlock blockName) (if (and (setq ss (ssget ":S:E" '((0 . "INSERT")))) (setq oBlock (vlax-ename->vla-object (ssname ss 0))) (= :vlax-true (vla-get-isxref (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)) ) (setq blockName (vla-get-effectivename oBlock)) ) ) ) ) (command "vpLAYER" "freeze" (strcat (vl-filename-base blockName) "|*") "" "" ) (prompt "\n** Must select an external reference ** ") ) (princ) ) Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 That functionality is built into the Layer Manager. Quote
Cad64 Posted December 23, 2015 Posted December 23, 2015 (edited) You can also use the LAYFRZ command. Edited December 23, 2015 by Cad64 Removed reference to Express Tools Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 (edited) I'm sorry, I didn't even read the thread or the LISP. (How about that?) It's a bit different than the topic title suggests. LAYFRZ is what you are looking for. Edited December 23, 2015 by RobDraw Quote
Cad64 Posted December 23, 2015 Posted December 23, 2015 The OP is using 2010, or at least that's what it says in his profile. I thought LAYFRZ was still in the Express Tools in 2010, but now that I've looked it up, I see that it wasn't. Oh well, even better. It's part of the core program so it can't be missing due to not loading Express Tools. So there you go. No need for a lisp routine when there is a standard command that does exactly what you need. I have edited my previous reply. Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 I was only providing additional information for those using newer versions. Quote
Dj_T_Rex2002 Posted December 23, 2015 Author Posted December 23, 2015 Thanks for the reply. I tried LAYFRZ but it freezes layer by layer. I would like to know if there is a way to make a LISP that you could just click on the XREF (we use many XREFs in our drawings) and just turn those layers off in that drawing. The code above is an example of what I am talking about and it works with our AutoCAD Architecture 2015 just fine, you go to viewport and click on the XREF you want to turn off and Voila, layers off. Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 Unloading the XREF via the right click contextual menu would just as fast and a much better way of doing that. Quote
Dj_T_Rex2002 Posted December 23, 2015 Author Posted December 23, 2015 RobDraw, I do know how to unload, delete, erase, freeze, turn off layers or XREFs. What I need is a LISP to freeze all layers when I click an XREF. I don't want to delete it, just want to freeze the layer without having to do it one at a time. It's hard to work on projects that are on top of each other when all lines are crossing (No we do not want to move the XREFs where they are located) this could cause anyone to just misplace the XREF or not put it back where it belongs. Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 I know what you are saying and just because you think you need a LISP doesn't mean it can't be done another way. I'm also saying that freezing all the layers may not be a good way of doing what you are trying to do. What are you going to do when you want to thaw the layers? Another LISP that thaws all the layers in the XREF when you click on it? Guess what? You can't select the XREF because all the layers are frozen. Unloading an XREF does EXACTLY what you are trying to accomplish and only requires it to be reloaded when you want to see it again. It is still in the drawing and ready for use, exactly the state and location it was in when you unloaded it, when you want to see it. Quote
ReMark Posted December 23, 2015 Posted December 23, 2015 The Layer Isolate command won't do basically what you want? LAYISO Hides or locks all layers except those of the selected objects. And then there is this.... LAYUNISO Restores all layers that were hidden or locked with the LAYISO command. Quote
ReMark Posted December 23, 2015 Posted December 23, 2015 This lisp originated with former member hyposmurf and was tweaked by fuccaro. Or freeze all layers except the current one via a macro like this by Ted Krysman. ^c^c_layer;freeze;*;; Quote
eldon Posted December 23, 2015 Posted December 23, 2015 If you create a layer for each XREF when inserting into the drawing, and then draw one line directly on that layer, then you only have to click on that one line to freeze the XREF. Quote
Dj_T_Rex2002 Posted December 23, 2015 Author Posted December 23, 2015 See the attached example. We work with XREFs all day and un-attaching and reattaching would be a pain. Also LAYISO won't work. Example.dwg Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 See the attached example. We work with XREFs all day and un-attaching and reattaching would be a pain. Also LAYISO won't work. You are going to post at least one more file if you are working with XREFs. Did I say unnattach? No, I said UNLOAD. It's just as simple as a LISP, plus you can RELOAD and have everything just the way it was when you unloaded it. If you really want a LISP for the layers, again ill-advised, post your question over in the LISP section. Quote
Dj_T_Rex2002 Posted December 23, 2015 Author Posted December 23, 2015 Crap I thought this was the LISP section haha. I am so sorry. Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 You really should try the unload/reload option. You are going to run into trouble with layers unless you set layer states and if you do that you still don;t need LISP for it. Quote
Dj_T_Rex2002 Posted December 23, 2015 Author Posted December 23, 2015 Well this horse is stupid haha ... I do get what you mean but the way they have all these walls set up is like "a layer for wall, layer for slab, layer for electrical stuff, layer for electrical wire, layer for electrical text, etc" and I asked "why the hell not make it more simple?" but they say it's been the way they been doing it. It's frustrating. Quote
RobDraw Posted December 23, 2015 Posted December 23, 2015 Wow, that is the way it should be done. Why are you still stuck on the layers? You don't need to do anything with them. Trust me. I've been working with XREFs for over 15 yrs. Quote
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.