Command to freeze/thaw list of xref'd layers

Command to freeze/thaw list of xref'd layers

dfordTLARK
Observer Observer
1,217 Views
5 Replies
Message 1 of 6

Command to freeze/thaw list of xref'd layers

dfordTLARK
Observer
Observer

Hello! 

 

At the start of a project I have a specific workflow. A "base" file where most of the work on a project is done is created and a long list of layers are imported to that base. Then several "sheet files" are created that xref in the base. Each sheet file has a unique freeze/thaw state for the layers xref'd in from the base. Sometimes the colors of certain layers are also modified. The name of the layers are all standard, but the base file will have a unique name based on the project. 

My question is, can I effectively automate the freeze/thaw work using a LISP command? Is there a better way to do it? 

 

Thank you

0 Likes
1,218 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

It sounds to me like DraWing Template [.DWT] files would be the better way to go.  Set one up for each type of project, use them as the basis for all New drawings, and all of that will be in place.

Kent Cooper, AIA
Message 3 of 6

dfordTLARK
Observer
Observer

I've looked into using a DWT after reading your comment. But I think my scenario precludes the viability of this method. 

My project organization look like this: Project01_Base.dwg is created then several separate .DWG'sthat reference Project01_Base are also created. Each one of these .DWG's references Project01_Base.dwg and has their own standard layer state that is consistent across all projects in the company. I could make a .DWT of those standardized layer states as you suggest. But when I start my next project, Project02_Base.dwg, say. That file will be in a different folder on the server and will not be the xref used in the making of the .DWT  therefor breaking the freeze/thaw states. 

Let me know if I'm miss understanding the capabilities of a DWT,

0 Likes
Message 4 of 6

Sea-Haven
Mentor
Mentor

You could make a list of layers to freeze, then add to them the xrefname then freeze etc. So "BASE_02|TA-DIM". No idea what layers you want so no code. You can have multiple lists for each dwg type and just use correct list, if layer does not exist Freeze may not cause an error, not sure without testing. 

 

Ps can export out layers using lisp to text screen then copy and paste into a lisp. Or turn on logfile can get names from there.

0 Likes
Message 5 of 6

ronjonp
Mentor
Mentor

@dfordTLARK wrote:

I've looked into using a DWT after reading your comment. But I think my scenario precludes the viability of this method. 

My project organization look like this: Project01_Base.dwg is created then several separate .DWG'sthat reference Project01_Base are also created. Each one of these .DWG's references Project01_Base.dwg and has their own standard layer state that is consistent across all projects in the company. I could make a .DWT of those standardized layer states as you suggest. But when I start my next project, Project02_Base.dwg, say. That file will be in a different folder on the server and will not be the xref used in the making of the .DWT  therefor breaking the freeze/thaw states. 

Let me know if I'm miss understanding the capabilities of a DWT,


@dfordTLARK 

Why are you changing the names of the drawings if they could be organized in a a different folder and named the same? Then the template 'should' work.

0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Having worked where we started with external data I can see why the "BASE" dwg may have any name. 

 

@dfordTLARK  This is make a layer list so can copy and paste to say notepad remove layers that do not need to be frozen or add more. Then use in a new lisp. 

 

 

(setq lst '())
(vlax-for lyr (vla-get-layers (vla-get-activedocument (vlax-get-acad-object) ) )
(setq lst (cons (vlax-get lyr 'name) lst))
)

 

 

0 Likes