Script to Turn Xref Layers On/Off

Script to Turn Xref Layers On/Off

dmacdermott
Participant Participant
366 Views
2 Replies
Message 1 of 3

Script to Turn Xref Layers On/Off

dmacdermott
Participant
Participant

Hello,

 

My company uses Civil3D 2023 currently.  I previously created a script that automatically creates multiple layers and applies various layer properties to each, as well as turning specific layers to NO PLOT.  I wish to do the same thing with any Xref's - turning these same specific No Plot layers On/Off within the xrefs.  

 

Is this possible?

 

Thank you,

Drew

0 Likes
Accepted solutions (1)
367 Views
2 Replies
Replies (2)
Message 2 of 3

brian.strandberg
Advisor
Advisor
Accepted solution

Sure, you have a few options.

 

1) You can use wildcards in your script to fit a bunch of different conditions.  Here is a reference: https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-68373F99-17F1-4AC4-8D37-184C49164705

2) What I often do is change the block name in the xref.  So if I xref 11846_Topo, I will change the block name in the XREF manager to just be TOPO.  Since the block name will generally be the same on all my drawings, it unleashes a whole bunch more options for doing this (script, layer filter).  

 

Let me know if this got you going.  Thanks.

Check out my Civil 3d blog at: http://c3dk.com/
Favorite Posts: Use Dynamo For Surface Analysis: https://youtu.be/eJNdX6guMP8
Fast Track your site grading with the new Corridor Workflow: https://youtu.be/Gg7u9-LgIL0
0 Likes
Message 3 of 3

dmacdermott
Participant
Participant

Following up to confirm that wildcards make easy work of this exercise.  For example, I never want to plot road centerlines, surface boundaries, or survey points in our final Civil sheets.  In order to make those layers no plot in my DWG and in the xref's, I added asteriks as shown in a few example layers below:

 

..... *X-CL,*PNTS*MISC,*PNTS*CNTRL,*SRF-BOUNDARY,*SRF-BREAK, .....

 

So far, it seems to be working! Thanks @brian.strandberg!

0 Likes