オブジェクトまたはアプリケーションの表示/非表示を指定します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.Visible
タイプ: すべての図形オブジェクト、Application、AttributeReference、Group、Toolbar
このプロパティが適用されるオブジェクト。
読み込み専用: いいえ(書き込み専用の Group オブジェクトを除く)
タイプ: ブール型
オブジェクトを非表示に指定すると、アプリケーションの可視設定にかかわらず見えなくなります。オブジェクトが見えなくなる原因はほかにもあります。たとえば、オブジェクトの画層がオフまたはフリーズになっていると、そのオブジェクトは表示されません。
アプリケーションを見えないように指定すると、コンポーネントを見ないでバックグラウンドのタスクを実行できます。
VBA:
Sub Example_Visible()
' This example creates a line in model space.
' It then turns visibility of the line on or off, depending
' on the user's choice.
Dim lineObj As AcadLine
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
' Create the line
startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
ZoomAll
Dim response As Integer
response = MsgBox("Do you want the new line to be visible?", vbYesNoCancel + vbQuestion)
Select Case response
Case vbYes
lineObj.Visible = True
Case vbNo
lineObj.Visible = False
Case vbCancel
Exit Sub
End Select
ThisDrawing.Regen True
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Visible()
;; This example creates a line in model space.
;; It then turns visibility of the line on or off, depending
;; on the user's choice.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the line
(setq startPoint (vlax-3d-point 2 2 0)
endPoint (vlax-3d-point 4 4 0))
(setq modelSpace (vla-get-ModelSpace doc))
(setq lineObj (vla-AddLine modelSpace startPoint endPoint))
(vla-ZoomAll acadObj)
(setq kwordList "Yes No")
(vla-InitializeUserInput (vla-get-Utility doc) 1 kwordList)
(setq response (vla-GetKeyword (vla-get-Utility doc) "Do you want the new line to be visible? [Yes/No]: "))
(cond
((= response "Yes") (vla-put-Visible lineObj :vlax-true))
((= response "No") (vla-put-Visible lineObj :vlax-false))
)
(vla-Regen doc :vlax-true)
)