没有合适的资源?快使用搜索试试~ 我知道了~
ARX Programming Environment
需积分: 10 1 下载量 29 浏览量
2011-09-28
13:57:22
上传
评论
收藏 6.09MB PDF 举报
温馨提示
ARX Programming Environment
资源推荐
资源详情
资源评论
OBJECTARX™ DEVELOPER’S GUIDE
00120-010000-5060 January 19, 1999
12345678910
Copyright © 1999 Autodesk, Inc.
All Rights Reserved
AUTODESK, INC. MAKES NO WARRANTY, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, REGARDING THESE MATERIALS
AND MAKES SUCH MATERIALS AVAILABLE SOLELY ON AN “AS-IS” BASIS.
IN NO EVENT SHALL AUTODESK, INC. BE LIABLE TO ANYONE FOR SPECIAL, COLLATERAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING OUT OF PURCHASE OR USE OF THESE MATERIALS. THE
SOLE AND EXCLUSIVE LIABILITY TO AUTODESK, INC., REGARDLESS OF THE FORM OF ACTION, SHALL NOT EXCEED THE
PURCHASE PRICE OF THE MATERIALS DESCRIBED HEREIN.
Autodesk, Inc. reserves the right to revise and improve its products as it sees fit. This publication describes the state of this product
at the time of its publication, and may not reflect the product at all times in the future.
Autodesk Trademarks
The following are registered trademarks of Autodesk, Inc., in the USA and/or other countries: 3D Plan, 3D Props, 3D Studio, 3D
Studio MAX, 3D Studio VIZ, 3D Surfer, ADE, ADI, Advanced Modeling Extension, AEC Authority (logo), AEC-X, AME, Animator
Pro, Animator Studio, ATC, AUGI, AutoCAD, AutoCAD Data Extension, AutoCAD Development System, AutoCAD LT, AutoCAD
Map, Autodesk, Autodesk Animator, Autodesk (logo), Autodesk MapGuide, Autodesk University, Autodesk View, Autodesk
WalkThrough, Autodesk World, AutoLISP, AutoShade, AutoSketch, AutoSolid, AutoSurf, AutoVision, Biped, bringing information
down to earth, CAD Overlay, Character Studio, Design Companion, Drafix, Education by Design, Generic, Generic 3D Drafting,
Generic CADD, Generic Software, Geodyssey, Heidi, HOOPS, Hyperwire, Inside Track, Kinetix, MaterialSpec, Mechanical Desktop,
Multimedia Explorer, NAAUG, Office Series, Opus, PeopleTracker, Physique, Planix, Rastation, Softdesk, Softdesk (logo), Solution
3000, Tech Talk, Texture Universe, The AEC Authority, The Auto Architect, TinkerTech, WHIP!, WHIP! (logo), Woodbourne,
WorkCenter, and World-Creating Toolkit.
The following are trademarks of Autodesk, Inc., in the USA and/or other countries: 3D on the PC, ACAD, ActiveShapes, Actrix,
Advanced User Interface, AEC Office, AME Link, Animation Partner, Animation Player, Animation Pro Player, A Studio in Every
Computer, ATLAST, Auto-Architect, AutoCAD Architectural Desktop, AutoCAD Architectural Desktop Learning Assistance,
AutoCAD DesignCenter, Learning Assistance, AutoCAD LT Learning Assistance, AutoCAD Simulator, AutoCAD SQL Extension,
AutoCAD SQL Interface, AutoCDM, Autodesk Animator Clips, Autodesk Animator Theatre, Autodesk Device Interface, Autodesk
PhotoEDIT, Autodesk Software Developer’s Kit, Autodesk View DwgX, AutoEDM, AutoFlix, AutoLathe, AutoSnap, AutoTrack, Built
with ObjectARX (logo), ClearScale, Concept Studio, Content Explorer, cornerStone Toolkit, Dancing Baby (image), Design Your
World, Design Your World (logo), Designer’s Toolkit, DWG Linking, DWG Unplugged, DXF, Exegis, FLI, FLIC, GDX Driver, Generic
3D, Heads-up Design, Home Series, Kinetix (logo), MAX DWG, ObjectARX, ObjectDBX, Ooga-Chaka, Photo Landscape,
Photoscape, Plugs and Sockets, PolarSnap, Powered with Autodesk Technology, Powered with Autodesk Technology (logo),
ProConnect, ProjectPoint, Pro Landscape, QuickCAD, RadioRay, SchoolBox, SketchTools, Suddenly Everything Clicks,
Supportdesk, The Dancing Baby, Transforms Ideas Into Reality, Visual LISP, and Volo.
Third Party Trademarks
Élan License Manager is a trademark of Élan Computer Group, Inc.
Microsoft, Visual Basic, Visual C++, and Windows are registered trademarks and Visual FoxPro and the Microsoft Visual Basic
Technology logo are trademarks of Microsoft Corporation in the United States and other countries.
All other brand names, product names or trademarks belong to their respective holders.
Third Party Software Program Credits
ACIS ® Copyright © 1994, 1997, 1999 Spatial Technology, Inc., Three-Space Ltd., and Applied Geometry Corp. All rights reserved.
Copyright © 1997 Microsoft Corporation. All rights reserved.
International CorrectSpell™ Spelling Correction System © 1995 by Lernout & Hauspie Speech Products, N.V. All rights reserved.
InstallShield™ 3.0. Copyright © 1997 InstallShield Software Corporation. All rights reserved.
Portions Copyright © 1991-1996 Arthur D. Applegate. All rights reserved.
Portions of this software are based on the work of the Independent JPEG Group.
Typefaces from the Bitstream ® typeface library copyright 1992.
Typefaces from Payne Loving Trust © 1996. All rights reserved.
The license management portion of this product is based on Élan License Manager © 1989, 1990, 1998 Élan Computer Group,
Inc. All rights reserved.
GOVERNMENT USE
Use, duplication, or disclosure by the U. S. Government is subject to restrictions as set forth in FAR 12.212 (Commercial Computer
Software-Restricted Rights) and DFAR 227.7202 (Rights in Technical Data and Computer Software), as applicable.
iii
Contents
About ObjectARX Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The ObjectARX Documentation Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Printed Guides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Online Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
ObjectARX Logo Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Where to Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Using This Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Part I Using ObjectARX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Chapter 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
The ObjectARX Programming Environment . . . . . . . . . . . . . . . . . . . . . . . . 8
Accessing the AutoCAD Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Interacting with the AutoCAD Editor . . . . . . . . . . . . . . . . . . . . . . . . . 8
Creating User Interfaces with MFC . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Supporting MDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Creating Custom Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Building Complex Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Interacting with Other Environments. . . . . . . . . . . . . . . . . . . . . . . . . 9
ObjectARX Class Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
AcRx Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
AcEd Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
AcDb Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
AcGi Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
AcGe Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
iv | Contents
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Installing ObjectARX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2 Database Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
AutoCAD Database Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Multiple Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Obtaining Object IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Essential Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Creating Objects in AutoCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Creating Objects in ObjectARX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Creating Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Creating a New Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Opening and Closing ObjectARX Objects . . . . . . . . . . . . . . . . . . . . 27
Adding a Group to the Group Dictionary. . . . . . . . . . . . . . . . . . . . . 28
Chapter 3 ObjectARX Application Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Creating an ObjectARX Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Creating Custom Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Responding to AutoCAD Messages . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Implementing an Entry Point for AutoCAD. . . . . . . . . . . . . . . . . . . 36
Initializing an ObjectARX Application . . . . . . . . . . . . . . . . . . . . . . . 37
Preparing for Unloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Example Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Registering New Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Command Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Lookup Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Global versus Local Command Names . . . . . . . . . . . . . . . . . . . . . . . 42
Transparent versus Modal Commands . . . . . . . . . . . . . . . . . . . . . . . 42
Loading an ObjectARX Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
The Library Search Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Listing Loaded ObjectARX Applications. . . . . . . . . . . . . . . . . . . . . . 43
Unloading an ObjectARX Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Unlocking Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Demand Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
AutoCAD, the Windows System Registry, and ObjectARX Applica-
tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Modification of the Registry at ObjectARX Application Installation 47
The DEMANDLOAD System Variable . . . . . . . . . . . . . . . . . . . . . . . . 49
Demand Loading on Detection of Custom Objects . . . . . . . . . . . . . 50
Demand Loading on Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Demand Loading on AutoCAD Startup . . . . . . . . . . . . . . . . . . . . . . 52
Managing Applications with the System Registry . . . . . . . . . . . . . . 52
ARX Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Contents | v
?—List Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Unload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Running ObjectARX Applications from AutoLISP . . . . . . . . . . . . . . . . . . . 55
Error Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 4 Database Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Initial Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating and Populating a Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Saving a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Setting the Default File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Global Save Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
The wblock Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Creating a New Database from an Existing Database . . . . . . . . . . . . 63
Creating a New Database with Entities . . . . . . . . . . . . . . . . . . . . . . . 64
Inserting a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Setting Current Database Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Database Color Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Database Linetype Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Database Linetype Scale Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Database Layer Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Example of Database Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Long Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Class and Function Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Long Transaction Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
External References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
External Reference Pre- and Post-Processing . . . . . . . . . . . . . . . . . . . 75
File Locking and Consistency Checks . . . . . . . . . . . . . . . . . . . . . . . . 76
Indexes and Filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Drawing Summary Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Last Saved by Autodesk Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Chapter 5 Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Opening and Closing Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Deleting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Database Ownership of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Adding Object-Specific Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Extended Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Extension Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Erasing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Object Filing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
剩余857页未读,继续阅读
资源评论
dinh_vu_vt2005
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功