vla-put-Visible 函数
功能
设定对象或应用程序的可见性。
语法及参数
(vla-put-Visible Object value)
Object All Drawing objects, Application,
AttributeReference, Group, Toolbar
这个属性适用的对象
value 布尔;读/写
TRUE: 对象或应用程序为可见。
FALSE: 对象或应用程序为不可见。
说明
如果将对象指定为不可见,无论应用程序的可见设置如何,它仍将不可见。还可其它因素会影响对象是否为可见,例如当对象的图层为闭合或冻结时,该对象都不会显示。
将应用程序指定为不可见时,可在背景执行工作而不必看到组件。
范例

- (defun Example_Visible ()
- ;;;这个范例在模型空间中创建一条线。
- ;;;接着切换线的可见性
- (VL-LOAD-COM)
- (setq AcadObject (vlax-get-acad-object)
- AcadDocument (vla-get-ActiveDocument Acadobject)
- mSpace (vla-get-ModelSpace Acaddocument)
- )
- (setq startPnt (vlax-make-safearray vlax-vbDouble '(0 . 2)))
- (vlax-safearray-fill startPnt '(10 10 0))
- (setq endPnt (vlax-make-safearray vlax-vbDouble '(0 . 2)))
- (vlax-safearray-fill endPnt '(50 50 0))
- ;;;创建线
- (setq LineObj (vla-AddLine mSpace startPnt endPnt))
- (vla-ZoomExtents AcadObject)
- (princ "要将新线设成可见的?")
- (setq response (vla-GetString
- (vla-get-Utility AcadDocument)
- :vlax-false
- "请输入<Yes>或<No>:"
- )
- )
- (cond
- ((and (= "yes" response) (= "y" response))
- (vla-put-Visible LineObj :vlax-true)
- )
- ((and (= "no" response) (= "n" response))
- (vla-put-Visible LineObj :vlax-false)
- )
- )
- (vla-Regen AcadDocument :vlax-true)
- (princ)
- )
|