CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

UCSIconOn Property (ActiveX)

2023-1-3 02:28| 发布者: admin| 查看: 192| 评论: 0|来自: AutoCAD

摘要: 指定 UCS 图标是否打开。

指定 UCS 图标是否打开。

支持的平台:仅窗口

签名

工 务 局:

object.UCSIconOn
对象

类型:光伏端口视口

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:UCS 图标已打开。
  • False:UCS 图标已关闭。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_UCSIconOn()
    ' This example toggles the setting of UCSIconOn.

    Dim viewportObj As AcadViewport
    
    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport
    
    ' Display the current setting of UCSIconOn
    MsgBox "UCSIcon is: " & IIf(viewportObj.UCSIconOn, "On", "Off"), , "UCSIconOn Example"

    ' Toggle the setting of UCSIconOn
    viewportObj.UCSIconOn = Not (viewportObj.UCSIconOn)
    
    ' Reset the active viewport to see the change
    ThisDrawing.ActiveViewport = viewportObj
    
    MsgBox "UCSIcon is now: " & IIf(viewportObj.UCSIconOn, "On", "Off"), , "UCSIconOn Example"
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_UCSIconOn()
    ;; This example toggles the setting of UCSIconOn.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Set the viewportObj variable to the activeviewport
    (setq viewportObj (vla-get-ActiveViewport doc))
    
    ;; Display the current setting of UCSIconOn
    (alert (strcat "UCSIcon is: " (if (= (vla-get-UCSIconOn viewportObj) :vlax-true) "On" "Off")))

    ;; Toggle the setting of UCSIconOn
    (vla-put-UCSIconOn viewportObj (if (= (vla-get-UCSIconOn viewportObj) :vlax-true) :vlax-false :vlax-true))
    
    ;; Reset the active viewport to see the change
    (vla-put-ActiveViewport doc viewportObj)
    
    (alert (strcat "UCSIcon is now: " (if (= (vla-get-UCSIconOn viewportObj) :vlax-true) "On" "Off")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 12:03

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部