Setting Viewport Layer Overrides for XREFs in Drawing Templates - How?

Setting Viewport Layer Overrides for XREFs in Drawing Templates - How?

nbawden
Advocate Advocate
1,382 Views
5 Replies
Message 1 of 6

Setting Viewport Layer Overrides for XREFs in Drawing Templates - How?

nbawden
Advocate
Advocate

Could someone please advise on the best way to set &  maintain viewport layer overrides for XREF layers in a template?

 

By default our template does not have any XREFs attached but we will, in 90% of projects, be adding XREFs from variable locations internally that are given the same XREF names in the drawing (e.g. source filneame is different but XREFs are given constant names "X Layout", "X Design" etc). We want to be be able to define the viewport layer overrides (freezwe\thaw, colour, lineweight) either in the template without the XREFs (or dummy equivalents) already attached or via applied fater the XREFs are attached via a very quick process (e.g. Layer States??).

 

What is the best way to achive this outcome?

0 Likes
Accepted solutions (1)
1,383 Views
5 Replies
Replies (5)
Message 2 of 6

jporter
Collaborator
Collaborator
I don't think it's possible because of the xref naming convention in layer properties manager. Maybe someone has a lisp routine for this?????
Jason Porter
ASTI Civil Solutions Technical Advisor
www.asti.com
0 Likes
Message 3 of 6

scot-65
Advisor
Advisor

Is there consistency between the source xref layer declarations and the destination file layers?

A LISP or script or macro may help using these guidelines:

The xref uses a "|" as part of the layer name regardless of the file name, or the xref name given in the destination file.

By mapping the destination layer's state in the viewport, an equivalent can be had for the xref.

For example:

F1wall is a layer found in the destination file.

*|F1wall would be the equivalent for the xref.

 

^C^Cvplayer;t;F1wall,*|F1wall;;;

conceptual.


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 4 of 6

nbawden
Advocate
Advocate

Yes there is a conistency in layer names. So lisp is the answer?

0 Likes
Message 5 of 6

scot-65
Advisor
Advisor
Accepted solution

The example I provided is a macro that can be populated anywhere in any of the on screen tools.

Open the CUI: command CUI.

Bottom left pane is the command list. Create a command and fill in the macro part.

Repeat as needed.

The top left pane is the tree. Create a sub-category by right-clicking on a tree item and select "New Menu".

Now drag-hold-and-drop your new command from the command list into the new sub-category.

Test your work.

 

52f3c297.gif

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 6 of 6

nbawden
Advocate
Advocate

Thanks for that - much appreciated.

 

Small wrinkle though. Our layer names have spaces in them e.g. "Design Sewer" and so using this command we have to put the quotation marks around layers which means we can't enter multiple layers names at once like your example has.

 

The command works fine for normal single "word" layer names - but when you have to use quotation marks you can only enter one layer at a time - bug in AutoCAD?? Either way it only means I have run through the command twice instead of once like your example shows.

 

 

0 Likes