Author Topic: Change XREF colors  (Read 5220 times)

0 Members and 1 Guest are viewing this topic.

Dave20165

  • Guest
Change XREF colors
« on: February 17, 2012, 02:40:07 PM »
Hello,

I did some searching but have not found anything on what I hope exists.  When I'm creating construction plans, I am often working a large section of lots that is broken up into 2 or 3 phases.  When I get to the 2nd phase/plan, I XREF the 1st phase's base file and change the layers to existing colors manually.  Is there some sort of batch convert tool that allows me to create a template of my proposed layers, with existing colors, then have it convert my XREF to match that?

Let me know if I did a terrible job of explaining what I'm looking for  :-D

Thanks

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Change XREF colors
« Reply #1 on: February 17, 2012, 03:34:54 PM »
This is certainly possible: the layer information could be silently retrieved from the template file using ObjectDBX, then the properties of the relevant xref-dependent layers in the active drawing could be modified to suit the obtained layer information; this would work for all layer properties, not limited to just colour.

It would almost be the reverse of my program here.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Change XREF colors
« Reply #2 on: February 17, 2012, 04:49:35 PM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Change XREF colors
« Reply #3 on: February 17, 2012, 04:51:07 PM »
lol, I had forgotton about that one, nice one Ron  :-P

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Change XREF colors
« Reply #4 on: February 17, 2012, 06:39:56 PM »
lol, I had forgotton about that one, nice one Ron  :-P

 8-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Dave20165

  • Guest
Re: Change XREF colors
« Reply #5 on: February 20, 2012, 10:51:14 AM »
Thanks for your replies gentlemen.  What I'm looking for is a little different though. I don't want to revert layers to what they used to be or match the XREF layers to the current drawings layers.  I want the layers in my XREF to match the layers of a 3rd drawing.

For example,
Let's say I have a drawing named "06-10-GRADE.dwg" which references the following:

P-Base.dwg
P-Topo.dwg
X-Base.dwg
X-Topo.dwg

06-10-GRADE.dwg has all my layout tabs for sheets 06-10 with viewports oriented properly and matchlines drawn in, North arrows, grid ticks, etc....

Now......at the end of my plan I need to have landscaping sheets.  This drawing will need all the same viewports, border, etc as the grading plan so I start by doing a save as of "06-10-GRADE.dwg".

On this plan we shade back all of the proposed(P-Topo.dwg, P-Base.dwg) layers.  I don't make them all the same color because I don't want them to all be the same line weight/color. So.....I change each layer individually to a different color.

What I was thinking was, if I could create a blank drawing with all the layers in P-Topo.dwg and P-Base.dwg but have the colors changed to the way I want to show them in the landscaping sheets and call it "Landscape Layers.dwg", then maybe there would be a way to alter XREF layers in my save as drawing to match these new layers?


VVA

  • Newt
  • Posts: 166
Re: Change XREF colors
« Reply #6 on: February 21, 2012, 09:32:12 AM »
because of his my terrible English, I do not fully understand the sense of previous post
Look, this variant can be satisfied?
ColorXREF change color xref only on a current session. All layer unlock and thaw
« Last Edit: February 22, 2012, 12:58:33 AM by VVA »

Dave20165

  • Guest
Re: Change XREF colors
« Reply #7 on: February 21, 2012, 10:08:18 AM »
My English is terrible?

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Change XREF colors
« Reply #8 on: February 21, 2012, 10:09:41 AM »
I think VVA was referring to himself  8-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Dave20165

  • Guest
Re: Change XREF colors
« Reply #9 on: February 21, 2012, 10:28:54 AM »
Oh :lol: that completely changes everything.

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Re: Change XREF colors
« Reply #10 on: February 21, 2012, 04:09:34 PM »
I do this for our MEP backgrounds.  Works just fine for us.

Code: [Select]
(defun C:Backgrounds-MEP ()
  (setq job (strcat "*"(substr (getvar "dwgname") 1 6)"*"))
  (command "-layer" "color" "251" job "freeze" "*A-KITN-COOL-HATC,*WALL-HATC" "color" "yellow" "*base*a-equip-hood" "" "regenall")
  );defun


(defun C:Backgrounds-Equip ()
  (command "-layer" "C" "251" "*BASE*" "")
  (command "-layer" "C" "3" "*BASE*A-KITN-COOL*,*BASE*A-EQUIP,*BASE*A-PLUM-FIXT" "")
  (command "-layer" "C" "8" "*BASE*COOL-HATC" "")
  (command "-layer" "C" "2" "*BASE*A-EQUIP-HOOD" "L" "HIDDEN" "*BASE*A-EQUIP-HOOD"  "")
  (command "-layer" "C" "1" "*BASE*A-FURN" "")
  (command "-layer" "f" "*BASE*WALL-HAT*" "")
  );defun

VVA

  • Newt
  • Posts: 166
Re: Change XREF colors
« Reply #11 on: February 22, 2012, 01:01:35 AM »
I think VVA was referring to himself  8-)
Yes.
Dave20165, I'm sorry. Too trusting computer translation