CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

应用程序属性 (ActiveX)

2023-1-3 22:50| 发布者: admin| 查看: 579| 评论: 0|来自: AutoCAD

摘要: 获取应用程序对象。

获取应用程序对象。

支持的平台:仅窗口

签名

工 务 局:

object.Application
对象

类型:所有对象

此属性适用的对象。

属性值

只读:是的

类型:应用

作为对象所有者的对象。Application

言论

对象表示应用程序的帧控件和路径设置,并提供在对象层次结构中向下导航的方法。Application

发布信息

释放:AutoCAD 2000 至 AutoCAD 2017

  • 此属性不再支持与文件依赖项和文件依赖项对象一起使用。

例子

工 务 局:

Sub Example_Application()
    ' This example creates a line and then uses the
    ' Application property of the line to return the
    ' application name.
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim myApp As AcadApplication
    
    ' Create a new line reference
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    lineObj.Update

    ' Return the application for the object
    Set myApp = lineObj.Application
    
    ' Display the name of the application
    MsgBox "The application name is: " & myApp.name, vbInformation, "Application Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Application()
    ;; This example creates a line and then uses the
    ;; Application property of the line to return the
    ;; application name.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Create a new line reference
    (setq startPoint (vlax-3d-point 0 0 0)
          endPoint (vlax-3d-point 2 2 0))

    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq lineObj (vla-AddLine modelSpace startPoint endPoint))
    (vla-Update lineObj)

    ;; Return the application for the object
    (setq myApp (vla-get-Application lineObj))
    
    ;; Display the name of the application
    (alert (strcat "The application name is: " (vla-get-Name myApp)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 12:17

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部