CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

LayerPropertyOverrides Property (ActiveX)

2023-1-3 12:47| 发布者: admin| 查看: 543| 评论: 0|来自: AutoCAD

摘要: 指定外部参照或视口是否具有图层特性覆盖。

指定外部参照或视口是否具有图层特性覆盖。

支持的平台:仅窗口

签名

工 务 局:

object.LayerPropertyOverrides
对象

类型:比较参考,外部参考光伏端口

此属性适用的对象。

属性值

只读:是的

类型:布尔

  • True:外部参照或视口具有图层属性覆盖。
  • False:外部参照或视口没有图层属性覆盖。

言论

对象从中继承此属性,但此属性在使用时不会影响该类型的对象。ComparedReferenceExternalReferenceComparedReference

例子

工 务 局:

Sub Example_LayerPropertyOverrides()
    ' This example checks to see if the viewports in Paper Space
    ' have one or more layer property overrides applied.
    
    Dim acObj As AcadObject
    
    ' Step through the objects in Paper space
    For Each acObj In ThisDrawing.PaperSpace
        ' Check to see if the object is a Viewport
        If acObj.ObjectName = "AcDbViewport" Then
            ' Display the Layer Properties Override status for the viewport
            GoSub DISPLAYSTATUS
        End If
    Next acObj
    
    Exit Sub
    
DISPLAYSTATUS:
    Dim vpObj As AcadPViewport
    Set vpObj = acObj

    ' Get the ObjectId for the viewport
    Dim strObjId as string
    strObjId = "ObjectId: " + CStr(vpObj.ObjectId)

    ' Display a message based on whether the viewport has layer overrides applied
    If vpObj.LayerPropertyOverrides Then
        MsgBox strObjId + vbLf + "Viewport does have layer property overrides applied.", , "LayerPropertyOverrides Example"
    Else
        MsgBox strObjId + vbLf + "Viewport doesn't have any layer property overrides applied.", , "LayerPropertyOverrides Example"
    End If
    Return
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LayerPropertyOverrides()
    ;; This example checks to see if the viewports in Paper Space
    ;; have one or more layer property overrides applied.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Step through the objects in Paper space
    (vlax-for acObj (vla-get-PaperSpace doc)
        ;; Check to see if the object is a Viewport
        (if (= (vla-get-ObjectName acObj) "AcDbViewport")
            (progn
                ;; Get the ObjectId for the viewport
                (setq strObjId (strcat "ObjectID: " (itoa (vla-get-ObjectId acObj))))
                ;; Display a message based on whether the viewport has layer overrides applied
                (if (= (vla-get-LayerPropertyOverrides acObj) :vlax-true)
                    (alert (strcat strObjId
                                   "\nViewport does have layer property overrides applied."))
                    (alert (strcat strObjId
                                   "\nViewport doesn't have any layer property overrides applied."))
                )
            )
        )
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 08:50

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部