指定图层的冻结状态。 支持的平台:仅窗口 属性值只读:不 类型:布尔
言论冻结层使它们不可见,并将它们排除在再生和绘图之外。解冻图层可实现这些功能。关闭或冻结图层上的 AutoCAD 曲面和圆是不可见的,但在使用“隐藏”、“着色模式”或“渲染”命令时,它们仍会隐藏对象。 不能冻结活动图层,也不能使冻结图层处于活动状态。 此属性与属性不同,因为在再生期间不会生成冻结层。LayerOn 例子工 务 局: Sub Example_Freeze()
' This example creates a new layer called "Freeze".
' It then displays the status of the Freeze property
' for the new layer, toggles the status of the
' Freeze property, and again displays its status.
' After running this example, you can check the layer
' control on the Object Properties tool bar. It will
' show the new layer and the latest Freeze status.
Dim layerObj As AcadLayer
' Create the new layer
Set layerObj = ThisDrawing.Layers.Add("Freeze")
' Display the Freeze status of the new layer
GoSub DISPLAYSTATUS
' Toggle the status of the Freeze property for the layer
layerObj.Freeze = Not (layerObj.Freeze)
' Display the Freeze status of the new layer
GoSub DISPLAYSTATUS
Exit Sub
DISPLAYSTATUS:
If layerObj.Freeze Then
MsgBox "Layer " & layerObj.name & " is frozen.", , "Freeze Example"
Else
MsgBox "Layer " & layerObj.name & " is thawed.", , "Freeze Example"
End If
Return
End Sub
Visual LISP: (vl-load-com)
(defun c:Example_Freeze()
;; This example creates a new layer called "Freeze".
;; It then displays the status of the Freeze property
;; for the new layer, toggles the status of the
;; Freeze property, and again displays its status.
;; After running this example, you can check the layer
;; control on the Object Properties tool bar. It will
;; show the new layer and the latest Freeze status.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the new layer
(setq layerObj (vla-Add (vla-get-Layers doc) "Freeze"))
;; Display the Freeze status of the new layer
(if (= (vla-get-Freeze layerObj) :vlax-true)
(alert (strcat "Layer " (vla-get-Name layerObj) " is frozen."))
(alert (strcat "Layer " (vla-get-Name layerObj) " is thawed."))
)
;; Toggle the status of the Freeze property for the layer
(vla-put-Freeze layerObj (if (= (vla-get-Freeze layerObj) :vlax-true) :vlax-false :vlax-true))
;; Display the Freeze status of the new layer
(if (= (vla-get-Freeze layerObj) :vlax-true)
(alert (strcat "Layer " (vla-get-Name layerObj) " is frozen."))
(alert (strcat "Layer " (vla-get-Name layerObj) " is thawed."))
)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-28 21:12
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.