Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command to freeze/thaw list of xref'd layers

5 REPLIES 5
Reply
Message 1 of 6
dfordTLARK
341 Views, 5 Replies

Command to freeze/thaw list of xref'd layers

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

Labels (5)
5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: dfordTLARK

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
in reply to: Kent1Cooper

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,

Message 4 of 6
Sea-Haven
in reply to: dfordTLARK

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.

Message 5 of 6
ronjonp
in reply to: dfordTLARK


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

Message 6 of 6
Sea-Haven
in reply to: ronjonp

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

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report