CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

冻结属性 (ActiveX)

2023-1-3 15:55| 发布者: admin| 查看: 446| 评论: 0|来自: AutoCAD

摘要: 指定图层的冻结状态。

指定图层的冻结状态。

支持的平台:仅窗口

签名

工 务 局:

object.Freeze
对象

类型:图层

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:冻结图层。
  • False:解冻图层。

言论

冻结层使它们不可见,并将它们排除在再生和绘图之外。解冻图层可实现这些功能。关闭或冻结图层上的 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."))
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 20:28

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部