@mhupp FWIW, This would be quite a bit more efficient since it's not iterating all the layers:
(foreach la '("Construction_Layer" "Construction_Layer2" "Construction_Layer3")
(if (setq e (tblobjname "layer" la))
(vla-put-lock (vlax-ename->vla-object e) :vlax-true)
)
)
@3dwannab
FWIW .. instead of making a new block for different sizes that have the same geometry create one definition that is 1unit * 1unit and set it to scale uniformly then you can set the size based on the actual canopy area. If it was structured like this, then all you have to do is grab the X value and set that the same on your new block. Just some organizational insight.
Block Replace but Retain Overall Size - RJP.dwg
There might be a better way to do it but this should work.
(defun C:S (/ lst)
(vl-load-com)
(setq lst '("Construction_Layer" "Construction_Layer2" "Construction_Layer3")) ;layers you want to lock and unlock
(foreach lay lst
(if (setq e (tblobjname "layer" la))
(vla-put-lock (vlax-ename->vla-object e) :vlax-true)
)
)
(command "_.Stretch" pause)
(foreach lay lst
(if (setq e (tblobjname "layer" la))
(vla-put-lock (vlax-ename->vla-object e) :vlax-false)
)
)
)
Hi mhupp, thank you for helping me. Is it possible to lock and unlock multiple layers ?
"Construction_Layer1, Construction_Layer2, Construction_Layer3"
How to draw a line in Blender? Mode: Draw Mode. Tool: Line. It's amazing what you can find with a simple search.
The topic is covered in the Blender Manual which users have access to as part of the program.