指定外部参照或视口是否具有图层特性覆盖。 支持的平台:仅窗口 属性值只读:是的 类型:布尔
言论对象从中继承此属性,但此属性在使用时不会影响该类型的对象。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.")) ) ) ) ) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:22
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.