Lock all XREF layers, but if on current (unlocked) layer, make new layer?

Lock all XREF layers, but if on current (unlocked) layer, make new layer?

Anonymous
Not applicable
975 Views
2 Replies
Message 1 of 3

Lock all XREF layers, but if on current (unlocked) layer, make new layer?

Anonymous
Not applicable

 

I'm fairly new to coding .lsp:s and making scripts, but I would like to make a script (button) that locks all XREF layers, which seems fairly simple:

 

(COMMAND "_.layer" "_lock" "*|*" "")
(COMMAND "_qsave")
(COMMAND "_Close")

HOWEVER, if XREF(s) are on the current layer, which happens to be unlocked, I would like to create a new, locked layer to which I sent these XREF:s.

 

What would be the best way to code this?

0 Likes
976 Views
2 Replies
Replies (2)
Message 2 of 3

Moshe-A
Mentor
Mentor

Hi,

 

What would you achieve by locking xref layers?

you can not set xref layer current and even it it is locked you still can modify other layer properties.

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

I'm using a LOCKSELECTION script, which prevents me from being able to select a locked layer. This helps me as I'm making selections only on relevant layers and the locked layers work only as a backdrop.

 

I never want XREF:s to be selectable, and therefore want to have a quick command/button to lock all of them.

0 Likes