Author Topic: Freezing Xref Layers  (Read 9926 times)

0 Members and 1 Guest are viewing this topic.

TomREd

  • Guest
Freezing Xref Layers
« on: October 11, 2006, 04:22:06 PM »
Ok, so I hae this huge school project and the Arch. has determined that there will be a base bid, an alternate #1, alternate #2.

Now this is fine well and good but the arch has set his up is mad. Xrefs inside of xrefs....this just makes me angry to start with... so after seperating everything, coloring as i would like them to be...i mad one new drawing and xrefed all the pieces together, and I had hoped that i could bind them all together with a bind-bind so that i would be left with very clearly differnt layer sets. as each of these drawings were sharing layer descriptions (ie. a-wall) this was a layer in each set the exist. biulding, the new section of building and the alternate sections. Now I hope you can see why i wanted to bind them so I had Ex.-a-wall, new-a-wall, and alt1-a-wall. well afer binding and all i thought i was in the home strect of setting up the hundred or so drawings that i need to create. well in creating the first sheet, I went in to try to freeze layers to make my floor plan, the dam things wont freeze and it keeps spitting out a message in the command line like :No matching layer names found. Damn well i though i left those bound xref as blocks in what i had hoped to be my xrefs. well i went and bursted the bound xrefs. to no avail. still same error. any suggestions...sorry so long winded just wanted to give as much info as possible!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Freezing Xref Layers
« Reply #1 on: October 11, 2006, 04:41:58 PM »
Are all the drawings that comprise the project too big to zip up and post (or the info too proprietary)?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #2 on: October 11, 2006, 04:49:06 PM »
I am kind of leary of posting drawings, but I would guess that it has nothing to do with the drwaings themselves. Its the matter of what happens when you bind these files together to create a new drawing and then after all that is done, I cannot freeze layers unless I select it from the layer manager.

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #3 on: October 11, 2006, 04:53:42 PM »
try yourself create three differnt drawings all with the same layer inside. for example:

new
old
future

inside each of these drawings create a layer wall

then xref each of the drawings together into one drawing, with the intent to bind-bind them together so that you end up with

new-wall
old-wall
future-wall

then use that as your new xref and xref into a new drawing. then try to change layers in the viewport.

they damn things wont respond, keep getting an error to the effect of: No matching layer names found


this is a basic explination of what im trying to do...hope this is more clear!

pmvliet

  • Guest
Re: Freezing Xref Layers
« Reply #4 on: October 11, 2006, 05:01:29 PM »
I cannot freeze layers unless I select it from the layer manager.

I understand your pain and what you are going through. The Architect has made it worse by doing all his nested xref's and such. I'm not exactly clear on if you just have one reference file now or if you have multiple xref's or blocks withing this one reference file. The basic jist of what I'm trying to say is that the layer names are not found due to that fact that something is being represented by a layer for which it doesn't belong to. Thats confusing.

It's like a block which has it's linework created on layer 0. When inserted it takes upon the properties of the layer it is inserted on. If the block is created with linework on layers 1, 2, & 3 and inserted on layer 4.
Things will get messed up. If you use the pick-freeze whcih you are trying to do, it will infact freeze layer 4, but layers 1,2 & 3 will still be visible. Even if you picked the entity that was created on layer 1.

If you confirm that this is true, then what you need to do (re-reading your post). You left the different xref's as blocks and then you exploded them. When you did this, what layer was current? and do you still have blocks beneath these blocks?

I just read you latest post and will try that.

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Freezing Xref Layers
« Reply #5 on: October 11, 2006, 05:16:02 PM »
Sorry but I don't understand your problem.
What exactly are you trying to do with the layer & what is the exact name of the layer.
To freeze a xref layer use the layer manager, see below.

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Re: Freezing Xref Layers
« Reply #6 on: October 11, 2006, 05:17:15 PM »
then xref each of the drawings together into one drawing, with the intent to bind-bind them together so that you end up with

Do I bind this file? If you bind, the 3 different files becomes blocks.
Did you Bind or Insert?
If you Bind, you get layer names with:
old$0$wall
new$0$wall
future0$wall

If you insert, you get a  layer name of:
wall
with the properties of the layer that was in the first reference file attached/inserted.
all the items from the 3 different files go onto the same layer.

inserting also put's it into a block which is consistent of the file name.

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #7 on: October 11, 2006, 05:21:55 PM »
the whole reason i used the bind-bind command and not the bind-insert, was so that i would get a tag in front of the layer i.e. my example

old-wall
new-wall
future-wall

I can freeze from the layer pulldown or the layer manager, but my express tool layfrz wont select anything inside the viewport or in model space. This is what most people in my ofice use to freeze and the reason for my concern. I have no problem selecting the layers i want on and off from the menu but I dont want to have to hear it from thirty people in my office.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #8 on: October 11, 2006, 05:26:26 PM »
See if this works for you.
Code: [Select]
(defun c:LayFrez (/ ActDoc LayCol Sel EntData LayList BlkCol)

(vl-load-com)
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vla-EndUndoMark ActDoc)
(vla-StartUndoMark ActDoc)
(setq LayCol (vla-get-Layers ActDoc))
(setq BlkCol (vla-get-Blocks ActDoc))
(setvar "errno" 0)
(while (not (equal (getvar "errno") 52))
 (if
  (or
   (initget "Undo")
   (setq Sel (nentsel "\n Select object on layer to be frozen [Undo]: "))
  )
  (if (= Sel "Undo")
   (if (car LayList)
    (progn
     (vla-put-Freeze (car LayList) :vlax-false)
     (prompt (strcat "\n Layer \"" (vla-get-Name (car LayList)) "\" has been Unfroze."))
     (setq LayList (cdr LayList))
     (vla-Regen ActDoc acActiveViewport)
    )
    (prompt "\n Nothing to undo.")
   )
   (progn
    (if
     (or
      (equal (length Sel) 2)
      (and
       (equal (length (last Sel)) 1)
       (= (vla-get-IsXref (vla-Item BlkCol (value 2 (entget (car (last Sel)))))) :vlax-true)
      )
     )
     (setq EntData (entget (car Sel)))
     (setq EntData (entget (car (last Sel))))
    )
    (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Freeze (list (setq LayObj (vla-Item LayCol (value 8 EntData))) :vlax-true)))
     (prompt (strcat "\n Could not freeze \"" (value 8 EntData) "\" layer."))
     (progn
      (prompt (strcat "\n Layer \"" (value 8 EntData) "\" has been frozen."))
      (setq LayList (cons LayObj LayList))
     )
    )
   )
  )
 )
)
(vla-EndUndoMark ActDoc)
(princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #9 on: October 11, 2006, 05:26:53 PM »
After using the bind command yes it creates blocks which were previously xrefs. I was on the 0 layer and used the burst command as to retain the layer settings from each of these drawings. Also I tried it with a full explode, neither made a difference.

And to add on, after attaching the newly created xref from the (previous 3) into a new drawing and the viewporting it to see if i could freeze layers and what not, i thought maybe i had an error or something and tried to detach the xref in ?, It tells me that its missing the xref and cannot detach...WTF!!!

The more I think about this the more I want to break something!

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #10 on: October 11, 2006, 05:34:29 PM »
Tim your lisp didn't do anything but give me a linetype error.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #11 on: October 11, 2006, 05:38:08 PM »
Tim your lisp didn't do anything but give me a linetype error.
It looks like it might not work the way you want it to anyway, but what did the command line say? can you copy/paste it here?

I didn't want it to pick nested layers in blocks, I wanted the block to freeze, but that is an easy fix, and I can tell you have to fix that one.  I want to know what the other error is that you are getting.

Real quick.  The part you would want to change is this
Code: [Select]

    (if
     (or
      (equal (length Sel) 2)
      (and
       (equal (length (last Sel)) 1)
       (= (vla-get-IsXref (vla-Item BlkCol (value 2 (entget (car (last Sel)))))) :vlax-true)
      )
     )
     (setq EntData (entget (car Sel)))
     (setq EntData (entget (car (last Sel))))
    )
to just
Code: [Select]
(setq EntData (entget (car Sel)))
This way it will pick the most nested object.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Freezing Xref Layers
« Reply #12 on: October 11, 2006, 05:47:23 PM »
the whole reason i used the bind-bind command and not the bind-insert, was so that i would get a tag in front of the layer i.e. my example

old-wall
new-wall
future-wall

I can freeze from the layer pulldown or the layer manager, but my express tool layfrz wont select anything inside the viewport or in model space. This is what most people in my ofice use to freeze and the reason for my concern. I have no problem selecting the layers i want on and off from the menu but I dont want to have to hear it from thirty people in my office.
If you are trying to get this
Quote
old-wall
new-wall
future-wall
A different way to attack this.

I use a lisp that prefixes a string in front of the all layer names found in a drawing.  then I take that drawing and insert into my working drawing and explode.  This will save you hassle of binding the xref.

let me go find that lisp...BRB

« Last Edit: October 11, 2006, 05:49:02 PM by Krushert »
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Kate M

  • Guest
Re: Freezing Xref Layers
« Reply #13 on: October 11, 2006, 05:50:40 PM »
Tom, what are your LAYFRZ options set to? Entity/Block/No nesting? Not sure if it'll help, but it may be worth a try.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Freezing Xref Layers
« Reply #14 on: October 11, 2006, 05:56:59 PM »
Tom, what are your LAYFRZ options set to? Entity/Block/No nesting? Not sure if it'll help, but it may be worth a try.

OPTIONS! OPTIONS! We have options? 
Say it not true. Where?
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #15 on: October 11, 2006, 06:02:15 PM »
Tom, what are your LAYFRZ options set to? Entity/Block/No nesting? Not sure if it'll help, but it may be worth a try.

OPTIONS! OPTIONS! We have options? 
Say it not true. Where?
Settings really.
Quote from: Acad command line
Command: layfrz

Current settings: Viewports=Vpfreeze, Block nesting level=Block
Select an object on the layer to be frozen or [Settings/Undo]:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #16 on: October 12, 2006, 08:40:48 AM »
I have tried all options and none of them made any difference....that lisp routine you spoke of that puts a string in front of all layer in the drawing, I am very intrested in.

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #17 on: October 12, 2006, 08:56:51 AM »
Allright boys and girls apperntly all i need was a cold morning a hot cup of coffee and fresh approach.

So this morning I created a new layer, made the new layer current and xrefed in the first section, then used the bind-bind command, after binding I exploded it. Well I wanted to check to see if the layer were freezable at this point so, I created a new drawing xrefed in the new file and to my amazement i was able to freeze layers. WOW!!! So to go on, I followed the same process step by step. and again to my amazement it still would freeze the layers....HOLY SHAT!!!

TO make a long story short I found a solution to my problem and its seems to be working....so I would like to thank all of you and have a wonderful rest of the day....as you can probably tell I am much ahppier this morning....


Oh yeah and most importantly----!!!! GO CARDS !!!

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Freezing Xref Layers
« Reply #18 on: October 12, 2006, 10:28:20 AM »
I have tried all options and none of them made any difference....that lisp routine you spoke of that puts a string in front of all layer in the drawing, I am very intrested in.

As requested.  I snagged this routine from Afra-lisp site.  

TO make a long story short I found a solution to my problem and its seems to be working....so I would like to thank all of you and have a wonderful rest of the day....as you can probably tell I am much ahppier this morning....
So what was the issue and the solution???? :? :?
Please don't leave us in suspense.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

TomREd

  • Guest
Re: Freezing Xref Layers
« Reply #19 on: October 12, 2006, 11:03:09 AM »
There were several things I changed the second time around...first of all I believe all of this was caused by haveing a # symbol in the file name...I should have know better then to do that but hey everybody makes mistakes. The other difference was not binding all the xrefs at the same time, but i believe this was just a coincidence.

I think the main factor was the file name..I'm such a dummy, I looked at # symbol when i first did it and had a feeling that may have been it but never changed it.....oh well it works fine now.

daron

  • Guest
Re: Freezing Xref Layers
« Reply #20 on: October 12, 2006, 01:12:55 PM »
<ding-ding>
Quote
...first of all I believe all of this was caused by haveing a # symbol in the file name...
I just saw this topic and while reading, all I could think of was a drawing I worked on a couple of weeks ago, where the only thing that would not freeze with my regularly used routine, were layers that contained #'s in their names. Caused me a lot of grief it did, but that was what I learned; # symbols and lisp apparently don't get along. Do any of the programming guru's understand why?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #21 on: October 12, 2006, 01:18:56 PM »
I think it is the way the code is written.  Or it could be because the '#' character can be use as a wild card match, instead of the '#' character itself.

/guesses, waiting for a guru to come along.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

daron

  • Guest
Re: Freezing Xref Layers
« Reply #22 on: October 12, 2006, 01:25:37 PM »
That would be my best guess too, but it's contained in a string. Hmm, must experiment... BBS (Be Back Soon.)

daron

  • Guest
Re: Freezing Xref Layers
« Reply #23 on: October 12, 2006, 01:31:54 PM »
Hmm. Curious. In the vlide I did this:
(setq a "343 # dfd")
It looks okay, so I inspect. It inspects okay, so I go to the command line and type !a. Lo-and-behold, it returns "343 # dfd". With all that a lisp should take that string and process it as requested, no? what gives here? Buggy program.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #24 on: October 12, 2006, 01:34:31 PM »
I would guess that the way the string is compared is the problem.  What does your part of the program look like when it is trying to freeze the layer?

Edit:
Did some testing with my routine.  I saved a drawings as 'Test#01.dwg', then xref'ed it into the current drawing.  I used my layer freeze command (posted above), and it worked fine.  Here is the output
Quote
Command: _LayFrez
Initializing...
 Select object on layer to be frozen [Undo]:
 Layer "Test#01|test" has been frozen.
 Select object on layer to be frozen [Undo]:
Then I binded it, as a bind, and here is the output
Quote
Command: _LayFrez
 Select object on layer to be frozen [Undo]:
 Layer "Test#01$0$test" has been frozen.
 Select object on layer to be frozen [Undo]:
« Last Edit: October 12, 2006, 01:38:23 PM by T.Willey »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

daron

  • Guest
Re: Freezing Xref Layers
« Reply #25 on: October 12, 2006, 01:38:01 PM »
Quote
What does your part of the program look like when it is trying to freeze the layer?
Do you mean (command "freeze" a "")? Read on, otherwise, I'm not sure what you're asking.

Alright, tested a bit more. I changed the value of a to "343 \# dfd" and !a returns "343 # dfd". To be expected, so I type:
(command ".layer" "f" a "")
and get a return of:
No matching layer names found.

Grrr.

P.S. I also have tried this with vplayer, same results.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #26 on: October 12, 2006, 01:46:31 PM »
I think the command way will interpret it as a wildcard instead of the actually character.  Try coding it so that it isn't a command.  Here is an example of what I mean.
Quote
Command: (setq Str (value 8 ent))
"Test#01$0$test"

Command: (command "_.layer" "_Freeze" Str "")

No matching layer names found.
nil

Command: (vla-put-Freeze (vla-Item (vla-get-Layers (vla-get-ActiveDocument (vlax-get-Acad-Object))) Str) :vlax-true)
Where the last line works to freeze the layer.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Freezing Xref Layers
« Reply #27 on: October 12, 2006, 01:50:42 PM »
Try this :

Code: [Select]
Command: (setq a "343 `# dfd")
"343 `# dfd"

Command: (command ".layer" "f" a "")

Quote
`  (reverse quote)   Escapes special characters (reads next character literally)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Freezing Xref Layers
« Reply #28 on: October 12, 2006, 01:53:27 PM »
Try this :

Code: [Select]
Command: (setq a "343 `# dfd")
"343 `# dfd"

Command: (command ".layer" "f" a "")

Quote
`  (reverse quote)   Escapes special characters (reads next character literally)
Nice one Alan!  Learned something new today.  :-D
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

daron

  • Guest
Re: Freezing Xref Layers
« Reply #29 on: October 13, 2006, 02:19:25 PM »
That's cool. Now the trick would be to have code that reads each string passed to it to find special characters, then place this before it. That or updating the working code with the vla-put-freeze should make it a bunch easier. I may have to do that. I think another job from the previous client is on the horizon and there's no telling what their layers will look like.

t-bear

  • Guest
Re: Freezing Xref Layers
« Reply #30 on: October 20, 2006, 08:45:59 AM »
I know I'm waaay behind on all this and I apologize, but I've been using this code for some time now. It will freeze layers within xrefs removing the need to bind....saves dwg size.....  Have a look.

Code: [Select]
(defun c:vplfrz   ()
  (setvar "TileMode" 0) ;  Force PaperSpace
  (setq vpFlag (getvar "cvport"))
  (if (= vpFlag 1)
    (progn
      (setq sel-vpt 1)
      (setq sel-vport (car (entsel "\nSelect view port: ")))
      (if (= sel-vport nil)
   (progn
     (alert "You must select a viewport\nTry again!")
     (c:vplfrz)
   )
   (progn
     (setq entvport (entget sel-vport))
     (if (= (cdr (assoc 0 entvport)) "VIEWPORT")
       (frz-vplayer)
       (progn
         (alert "You must select a viewport\nTry again!")
         (c:vplfrz)
       )
     )
   )
      )
    ); else Viewport is already selected
    (frz-vplayer)
  ) ;endif (= vpFlag 1)
)

(defun frz-vplayer ()
  (setq   e2    (entget sel-vport)
   viewport (cdr (assoc 69 e2))
  )
  (command "mspace")
  (setvar "cvport" viewport)
  (setq loop "")
  (while loop
    (setq
      pik (nentsel "\nSelect an item on XREF to Freeze: ESC to Exit:")
    )

    (cond
      ((/= pik nil)
       (setq lay (assoc 8 (entget (car pik))))
       (setq str (cdr lay))
       (command "vplayer" "f" str "All" "") ; Freeze in ALL viewports
      )
      ((= pik nil)
       (alert "Nothing Selected!\nTry Again!")
       (frz-vplayer)
      )
    )
  ) ; End while
  (command "pspace")
  (princ)
)

(prompt "\nType VPLFRZ to run")
(prin1)

I wish I could give credit to the author, but I don't remember where I got it....didn't write it down....my bad.

This just in!  CAB found my reference to this routine from waaaay back.

Quote
From the "gurus" at the CADalog forums, Keith, Trev, Hendie & Paul
;Thanks for this routine...3/7/03

....and thanks Alan!  Going to add this to the routine now..................
« Last Edit: October 20, 2006, 09:22:33 AM by t-bear »