Jump to content

Apply macro to all consultant xrefs


pixel8er

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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;*;;

 

?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Capture7-10-2014-54636PM3-11-2014-83245PM_zps9743dc24.png

 

Capture7-10-2014-54636PM3-11-2014-83156PM_zps95dace9f.png

 

Regards

Paul

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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