pixel8er Posted November 1, 2014 Share Posted November 1, 2014 Hi all I have a master xref file that I attach all the consultants xrefs to. The name of this master xref is XXXXX_SIT where XXXXX = project number. The master xref file is then overlayed into each sheet. What I would like to do then is have a tool palette macro that sets all the layers in the master xref file to colour 252. At the moment I have a script for each project that I manually apply to each sheet. I need to manually add the layer info for each xref to the script. I'm thinking this might be able to be automated. Does anyone have any hints? Thanks Paul Quote Link to comment Share on other sites More sharing options...
pixel8er Posted November 1, 2014 Author Share Posted November 1, 2014 Hi again So at the moment I have a script such as: LAYER C 252 100806*|*,XREF*|* ...that I drag and drop on each sheet to change the colour of those particular xref layers. The xref layer names need to be manually changed in the script for each project. What I'm wondering is if there is a way to: 1. Have a tool palette macro that can apply it to all xrefs that are attached to the master xref. 2. Or even better a lisp that can be loaded thru the acaddoc.lsp to run each time the drawings are opened to check for a XXXXX_SIT file and then change the colour of all the xref layers of all the xrefs in that file. Quote Link to comment Share on other sites More sharing options...
YZ Posted November 3, 2014 Share Posted November 3, 2014 Does the master xref have multiple xrefs inside it? And you want all of the layers inside the master and each of the xref'd dwgs to be colour 252? I may have misunderstood what you require. Can you not do: Layer;Colour;252;*;; ? Quote Link to comment Share on other sites More sharing options...
pixel8er Posted November 3, 2014 Author Share Posted November 3, 2014 Hi YZ Thanks for replying. Yes the master xref has multiple xrefs attached to it and yes I want all the layer colours of the xrefs attached to the master to be 252. But there are other xrefs also in the sheet that are not part of the master xref that need to remain as is (ie not changed to 252). Your code changes all xrefs layer colours to 252, whereas I need only the xrefs attached to the master xref to change to 252. My code works but needs to be changed for each new project - which is what I'm hoping to avoid Regards Paul Quote Link to comment Share on other sites More sharing options...
JGA Posted November 3, 2014 Share Posted November 3, 2014 How about;- ^c^c_-Layer;Color;252;*_SIT|*;; This should change the colour of all _SIT| layers. Quote Link to comment Share on other sites More sharing options...
pixel8er Posted November 3, 2014 Author Share Posted November 3, 2014 Hi JGA Thanks for replying. That would be ideal if that worked - I was thinking along those lines too. But it changes the colour of the top level layers but not those of the xrefs attached to the _SIT xref. See the images below for info of the typical layers and xrefs Regards Paul Quote Link to comment Share on other sites More sharing options...
JGA Posted November 4, 2014 Share Posted November 4, 2014 Eek, that's a heap of Xrefs! I think you are stuck with the script method, as their is no pattern in the naming conventions to work with. The only suggestion I can offer is to create a script to rename the xrefs attached to the *_SIT files to say x.A & x.B. Then you could extend your colour changing script to ^c^c_-Layer;Color;252;*_SIT|x.*;; Sorry I couldn't be more help. Quote Link to comment Share on other sites More sharing options...
pixel8er Posted November 4, 2014 Author Share Posted November 4, 2014 YES - that's it! Thanks so much JGA. I renamed the xrefs attached to the _SIT master xref to have a _SIT suffix. Then added this line of code to the acaddoc.lsp file: (command "-layer" "color" "252" "*_SIT|*" "") Now every time a drawing is opened it changes the layer colour of all the xrefs with the _SIT suffix to 252. Thanks again for your help Regards Paul Quote Link to comment Share on other sites More sharing options...
JGA Posted November 4, 2014 Share Posted November 4, 2014 Nice bit of lateral thinking there! Quote Link to comment Share on other sites More sharing options...
pixel8er Posted November 5, 2014 Author Share Posted November 5, 2014 Thanks for the suggestion to rename xrefs! 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.