CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

ActiveLayout Property (ActiveX)

2023-1-4 00:07| 发布者: admin| 查看: 462| 评论: 0|来自: AutoCAD

摘要: 指定活动布局。

指定活动布局。

支持的平台:仅窗口

签名

工 务 局:

object.ActiveLayout
对象

类型:文档

此属性适用的对象。

属性值

只读:

类型:布局

图形当前处于活动状态的布局。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_ActiveLayout()
    ' This example cycles through the documents collection
    ' and uses the ActiveLayout object to list the active layout
    ' for all open documents.

    Dim DOC As AcadDocument
    Dim msg As String
    
    ' If there are no open documents, then exit
    If Documents.Count = 0 Then
        MsgBox "There are no open documents!"
        Exit Sub
    End If
    
    msg = vbCrLf   ' Start with a space
    
    ' Cycle through documents and determine the active layout name using the
    ' ActiveLayout property of the document object
    For Each DOC In Documents
        msg = msg & DOC.WindowTitle & ": " & DOC.ActiveLayout.Name & vbCrLf
    Next
    
    ' Display results
    MsgBox "The active layouts for the open drawings are: " & msg
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ActiveLayout()
    ;; This example cycles through the documents collection
    ;; and uses the ActiveLayout object to list the active layout
    ;; for all open documents.
    (setq acadObj (vlax-get-acad-object))
    (setq docs (vla-get-Documents acadObj))  
    
    (setq msg "")
    
    ;; Cycle through the Documents collection and determine the active layout name using the
    ;; ActiveLayout property of the document object
    (vlax-for each-doc docs
        (setq msg (strcat msg (vla-get-WindowTitle each-doc) ": " (vla-get-Name (vla-get-ActiveLayout each-doc)) "\n"))
    )
    
    ;; Display results
    (alert (strcat "The active layouts for the open drawings are: \n\n" msg))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 02:42

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部