Jump to content

Freeze XRefs in Paper Space


Dj_T_Rex2002

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • RobDraw

    10

  • Dj_T_Rex2002

    7

  • ReMark

    2

  • Cad64

    2

Top Posters In This Topic

Posted Images

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 by RobDraw
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This lisp originated with former member hyposmurf and was tweaked by fuccaro.

 

FreezeAllLayersButOne.JPG

 

Or freeze all layers except the current one via a macro like this by Ted Krysman.

 

^c^c_layer;freeze;*;;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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