EaBIM一直以来积极响应国家“十二五”推进建筑业信息化的号召,对建筑领域的信息技术开展深入技术交流和探讨!致力于打造“BIM-建筑师-生态技术”三位一体综合资源交流共享平台,希望为BIM与可持续设计理念及技术的普及做出微小的贡献!!!

EaBIM

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 1020|回复: 11
打印 上一主题 下一主题

[资料] AutoCAD .NET API基础(一) AutoCAD 对象层次结构(1)

[复制链接]

1514

主题

7465

帖子

1万

积分

admin

Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10

积分
12406

社区QQ达人

跳转到指定楼层
F
发表于 2014-1-8 16:17:40 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
To use the AutoCAD® .NET API effectively you should be familiar with the AutoCAD entities, objects, and features related to the tasks you want to automate. The greater your knowledge of an object's graphical and nongraphical properties, the easier it is for you to manipulate them through the AutoCAD .NET API. For information specific to the members (methods, functions or properties) of an object in the AutoCAD .NET API, see the AutoCAD .NET Reference Guide.
要想有效利用AutoCAD® .NET API编程接口,必须熟悉AutoCAD自动化任务相关的AutoCAD实体、对象和特性等。你对对象的图形属性和非图形属性知道的越多,使用AutoCAD® .NET API对他们进行操作就越容易。AutoCAD .NET API对象各成员(方法、函数、属性等)的详细信息,请参见AutoCAD .NET参考指南。
Topics in this section:
本节内容:
·
Understand the AutoCAD Object Hierarchy 了解 AutoCAD 对象层次
·
Understand Properties and Methods了解属性和方法
·
Define Commands and AutoLISP Functions
定义命令和AutoLISP函数

Understand the AutoCAD Object Hierarchy
An object is the main building block of the AutoCAD .NET API. Each exposed object represents a precise part of AutoCAD. There are many different types of objects in the AutoCAD .NET API. Some of the objects represented in the AutoCAD .NET API are:
对象是AutoCAD .NET API的主要构成块。每个公开的对象都精确代表AutoCAD的一个部件。AutoCAD .NET API拥有许多不同类型的对象,例如:
·
Graphical objects such as lines, arcs, text, and dimensions直线、圆弧、文字和标注等图形对象;
·
Style settings such as layers, linetypes, and dimension styles 图层、线型、标注样式等样式设置对象;
·
Organizational structures such as layers, groups, and blocks图层、组、块等图形组织结构对象;
·
The drawing display such as view and viewport 视图、视口等图形显示对象;
·
Even the drawing and the AutoCAD application 乃至图形和AutoCAD应用程序本身也是对象;
The objects are structured in a hierarchical fashion, with the AutoCAD Application object at the root. This hierarchical structure is often referred to as the Object Model. The following illustration shows the basic relationships between the Application object and an entity that is in a BlockTableRecord, such as Model space. There are many more objects in the AutoCAD .NET API that are not represented here.
所有对象以AutoCADApplication对象为根对象,按层次结构方式组织,通常称层次结构为对象模型。下图所示表示了Application对象与BlockTableRecord模型空间内实体的基本关系。这里只列出了AutoCAD .NET API中的部分对象。




                               
登录/注册后可看大图









1The Application Object
Application
对象
The Application object is the root object of the AutoCAD .NET API. From the Application object, you can access the main window as well as any open drawing. Once you have a drawing, you can then access the objects in the drawing. For information on working with open drawing files (documents) see
The Document Object.
Application对象是AutoCAD .NET API的根对象,从Application对象,可以访问AutoCAD主窗口,以及任何打开的图形,并进而访问图形里的各个对象。有关处理打开图形文档的信息,参见Document对象。
For example, the Application object has a DocumentManager property that returns the DocumentCollection object. This object provides access to the the drawings that are currently open in AutoCAD and allows you to create, save and open drawing files. Other properties of the Application object provide access to the application-specific data such as InfoCenter, the main window, and the status bar.The MainWindow property allows access to the application name, size, location, and visibility.
例如,Application对象有一个DocumentManager属性,用来返回DocumentCollection对象,该对象提供了访问当前打开的AutoCAD图形的功能,并允许你创建、保存、打开图形文件。Application对象的其他属性提供了访问应用程序特有数据的功能,像信息中心InfoCenter、主窗口、状态栏等。MainWindow属性允许访问应用程序的名称、主窗口大小、位置及可见性等。
While most of the properties of the Application object allow access to objects in the AutoCAD .NET API, there are some that reference objects in the AutoCAD ActiveX® Automation. These properties include a COM version of the application object (AcadApplication), the menubar (MenuBar), loaded menugroups (MenuGroups), and preferences (Preferences).
Application对象的大多数属性允许对AutoCAD .NET API里的对象进行访问,同时也有一些属性是对AutoCAD ActiveX® Automation里的对象(COM对象)的引用,这些属性包括应用程序对象的COM版本(AcadApplication)、菜单栏(MenuBar)、加载的菜单组(MenuGroups)、以及选项设置(Preferences)等。



                               
登录/注册后可看大图





DocumentManager
Container for all the document objects (there is a document object for each drawing that is open). 所有文档对象的容器(每个打开的图形对应一个文档对象)
DocumentWindowCollection
Container for all the document window objects (there is a document window object for each document object in the DocumentManager). 所有文档窗口对象的容器(DocumentManager里每个文档对象有一个文档窗口对象)
InfoCenter
Contains a reference to the InfoCenter toolbar. 包含对信息中心工具栏的引用

MainWindow
Contains a reference to the application window object of AutoCAD. 包含对AutoCAD应用程序窗口对象的引用
MenuBar
Contains a reference to the MenuBar COM object for the menubar in AutoCAD. 包含对AutoCAD菜单栏对应的MenuBar COM对象的引用

MenuGroups
Contains a reference to the MenuGroups COM object which contains the customization group name for each loaded CUIx file. 包含对MenuGroups COM对象的引用,菜单组对象包含每个已加载CUIx文件的自定义组名
Preferences
Contains a reference to the Preferences COM object which allows you to modify many of the settings in the Options dialog box. 包含对Preferences COM对象的引用,该对象允许你在选项(Options)对话框里修改许多设置

Publisher
Contains a reference to the Publisher object which is used for publishing drawings.
包含对Publisher对象的引用,该对象用于发布图形
StatusBar
Contains a reference to the StatusBar object for the application window.
包含对应用程序窗口状态栏对象(StatusBar对象)的引用
UserConfiguration
Contains a reference to the UserConfiguration object which allows you to work with user saved profiles.
包含对UserConfiguration对象的引用,该对象允许你处理用户保存的配置信息

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 转播转播 分享分享 分享淘帖 支持支持 反对反对

相关帖子

工作时间:工作日的9:00-12:00/13:30-18:00,节假日不在线,请勿留言

8

主题

877

帖子

1362

积分

BIM经理

Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

积分
1362
11F
发表于 2014-6-13 14:35:03 | 只看该作者
(*^__^*) 嘻嘻……

12

主题

854

帖子

1923

积分

BIM经理

Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

积分
1923
8F
发表于 2014-6-13 14:15:08 | 只看该作者
路过!!!
不发表意见……
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|EaBIM网 ( 苏ICP备2020058923号-1  苏公网安备32011502011255号

GMT+8, 2024-11-27 10:03

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表