ObjectARX 2009
ObjectARX 2009
Quick Overview
Ha Noi, 1/11/2008
Introduction
ARX = AutoCad Runtime eXtension ObjectARX is an object oriented program library to extend AutoCad ObjectARX is developed by C++ Latest version is ObjectArx 2009 for Autocad 2009 and compatiable with Microsoft Visual Studion 2008 Download: http://autodesk.com/objectarx
ObjectArx 2009
Abilities
AutoCA D databas e Access Interact Other environments Build Create Support the MDI AutoCA D editor Interact Create UI with MFC
Complex applications
Custom classes
ObjectArx 2009
Class Libraries
AcEd
AcRx AcDb
ObjectARX
AcGi
Create Project
Using Wizard
ObjectArx 2009
Setting Project
Include Library
ObjectArx 2009
New Command
Test1 Command
ObjectArx 2009
AutoCad Database
Class AcDbDatabase
AutoCad Database
Color Dictionary Named Object Dictionary Group Dictionary Layout Dictionary
Layer Records Model Space Paper Space Textstyle Records View Records
Layer Table
Block Table
TextStyl eTable
View Table
Dictionar y Dictionary
Objects
Block Records
Entities
Entities
Entities
ObjectArx 2009
Assess a symbol
Get a database acdbCurDwg() Get a table Open a record - read/write
Process(get/set)
?
ObjectArx 2009
New Symbol
Open Table for write New a record (Layer, View, Ucs)
Set name Set properties
?
ObjectArx 2009
New Entity
New an object of a class inherit from AcDbEntity
Set properties (Layer, Color,) Set location
Append to database
Open Block table for read Open Block record (Model, Paper,) for write Append entity to block record Close
ObjectArx 2009
Access entity
Select object
Convert ename to objectId
Close
ObjectArx 2009
Delete object
Open object for write Call erase function Close object
ObjectArx 2009
Extension Data
AutoCad Database Block Table Object xData Entity Block Record Extension Dictionary Dictionary Named Object Dictionary
Custom Entity
Custom Object
ObjectArx 2009
Custom Object
Inherit from AcDbObject Define: ACRX_DXF_DEFINE_MEMBERS
ACRX_DXF_DEFINE_MEMBERS(CLASS_NAME, PARENT_CLASS, DWG_VERSION, MAINTENANCE_VERSION, PROXY_FLAGS , DXF_NAME, APP)
Custom Entity
Inherit from AcDbEntity Define: ACRX_DXF_DEFINE_MEMBERS Override: dwgIn, dwgOut, worldDraw, Init: rxInit() Unload: deleteAcRxClass() Use:
New a custom entity Set properties Set location Add to block record Close custom entity
ObjectArx 2009
Add xData
Registry AppName Build a struct resbuf list
acutBuildList(,RTNONE) New direct elements of resbuf
Open an object for write Call setXdata function with resbuf Close object Release resbuf
acutRelRb
ObjectArx 2009
Get xData
Open an object for read Call xData fuction with AppName to receive a resbuf Process resbuf Release resbuf Close object
ObjectArx 2009
ObjectArx 2009
Notifycation
Window Message
acedRegisterFilterWinMsg
acedRemoveFilterWinMsg
ObjectArx 2009
Use reactor
Inherit from a reactor class (AcDbDatabaseReactor...) Override events: (objectModified...) Determine reactor manager object: (AcDbDatabase, AcEditor...) Init: addReactor(this) Unload: removeReactor(this)
ObjectArx 2009
ObjectArx 2009
THE END
ObjectArx 2009
ObjectArx 2009
Class Libraries
Classes for binding an application and for runtime class registration and identification AcRx AcDb AcEd
ObjectARX
AcGi
Class Libraries
AcEd
AcRx
Classes for registering native AutoCAD commands and for AutoCAD event notification ObjectARX
AcDb
AcGi
Class Libraries
AcEd AutoCAD database classes
AcRx AcDb
ObjectARX
AcGi
Class Libraries
AcEd
AcRx AcDb Utility classes for common linear algebra and geometric objects
ObjectARX
AcGi
Class Libraries
AcEd
AcRx AcDb
ObjectARX
AcGi
ObjectArx 2009
ObjectArx 2009
ObjectArx 2009
ObjectArx 2009
ObjectArx 2009
ObjectArx 2009
ObjectArx 2009