指定属性或属性引用是否不可见。 支持的平台:仅窗口 属性值只读:不 类型:布尔
言论不可见属性将不会显示或打印。 属性只能作为四种可选模式之一存在:常量、预设、不可见或验证。AFLAGS 系统变量存储当前模式设置。可以使用属性查询当前模式。Mode 例子工 务 局: Sub Example_Invisible() ' This example creates an attribute definition in model space. ' It then queries the visibility of the attribute, changes ' the visibility, and queries the visibility again. Dim attributeObj As AcadAttribute Dim height As Double Dim mode As Long Dim prompt As String Dim insertionPoint(0 To 2) As Double Dim tag As String Dim value As String ' Define the attribute definition height = 1# mode = acAttributeModeVerify prompt = "New Prompt" insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0 tag = "New_Tag" value = "New Value" ' Create the attribute definition object in model space Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value) ZoomAll ' Find the current visibility for the attribute GoSub QUERYSTATUS ' Change the visibility of the attribute attributeObj.Invisible = Not attributeObj.Invisible ZoomAll GoSub QUERYSTATUS Exit Sub QUERYSTATUS: If attributeObj.Invisible Then MsgBox "The attribute is invisible." Else MsgBox "The attribute is visible." End If Return End Sub Visual LISP: (vl-load-com) (defun c:Example_Invisible() ;; This example creates an attribute definition in model space. ;; It then queries the visibility of the attribute, changes ;; the visibility, and queries the visibility again. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the attribute definition (setq insertionPoint (vlax-3d-point 5 5 0) attHeight 1 attMode acAttributeModeVerify attPrompt "New Prompt" attTag "NEW_TAG" attValue "New Value") ;; Create the attribute definition object in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq attributeObj (vla-AddAttribute modelSpace attHeight attMode attPrompt insertionPoint attTag attValue)) (vla-ZoomAll acadObj) ;; Find the current visibility for the attribute (if (= (vla-get-Invisible attributeObj) :vlax-true) (alert "The attribute is invisible.") (alert "The attribute is visible.") ) ;; Change the visibility of the attribute (vla-put-Invisible attributeObj (if (= (vla-get-Invisible attributeObj) :vlax-true) :vlax-false :vlax-true)) (vla-ZoomAll acadObj) (if (= (vla-get-Invisible attributeObj) :vlax-true) (alert "The attribute is invisible.") (alert "The attribute is visible.") ) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:25
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.