CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

新方法 (ActiveX)

2024-5-18 19:07| 发布者: admin| 查看: 118| 评论: 0|原作者: admin|来自: AutoCAD

新方法 (ActiveX)

在 SDI 模式下创建新文档。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.New(TemplateFileName)
对象

类别: 文档

此方法应用到的对象。

模板文件名

访问:仅输入

类型:字符串

模板文件的完整路径和文件名。

返回值 (RetVal)

类别: 文档

新创建的对象。Document

言论

只有在SDI模式下工作时,才应从对象调用该方法。在 MDI 模式下工作时,使用集合上的方法创建新图形。NewDocumentAddDocuments

例子

VBA:

Sub Example_New()
    ' This example creates a new drawing based on the template ansi-a.dwt.
    ' Note: The path to the template file is included with its name. Adjust
    ' this path for your installation location before running this example.
    
    Dim templateFileName As String
    templateFileName = "c:\AutoCAD\template\ansi-a.dwt"
    
    If AcadApplication.preferences.System.SingleDocumentMode = True Then
        ThisDrawing.New templateFileName
    Else
        ThisDrawing.Application.Documents.Add templateFileName
    End If

End Sub

可视化 LISP:

Not available

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-14 08:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部