1 / 135

ObjectARX 2010 Autodesk Developer Technical Services

ObjectARX 2010 Autodesk Developer Technical Services. Autodesk Developer Network (ADN). Access to almost all Autodesk software and SDK’s Including early access to Beta software Members-only website with 1000s of technical articles Unlimited technical support

Download Presentation

ObjectARX 2010 Autodesk Developer Technical Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ObjectARX 2010 Autodesk Developer Technical Services

  2. Autodesk Developer Network (ADN) • Access to almost all Autodesk software and SDK’s • Including early access to Beta software • Members-only website with 1000s of technical articles • Unlimited technical support • Product direction through conferences • Marketing benefits • Exposure on autodesk.com • Promotional opportunities • 1 to 3 free API training classes • Based on user level www.autodesk.com/joinadn

  3. Developer Technical Services Worldwide Workgroup • Over 25 Specialists World Wide • Virtually 24 hour support, 5 days a week Americas Team • CA, WA, São Paulo European Team • Switzerland, United Kingdom, France, Czech Republic, Russia APac Team • China, Japan, India

  4. Getting Support http://www.autodesk.com/adn-devhelp • Provides access to • On-line knowledgebase • Request submission • Newsgroups • Requests are logged automatically • 1-3 day turnaround • Callbacks as needed • Answers to frequently asked questions are posted in our on-line knowledge base

  5. Course Objective It is to understand: • The fundamentals of ObjectARX • How to teach yourself AutoCAD APIs • Where to get help with afterwards What it is not: • Teach you C++, C#, VB, .NET • Give you complete of coverage of all API functions

  6. Class Agenda Lectures with Labs • Slides give an abstract overview • Labs and my comments give the practical experience Lectures: • Overview of APIs • AutoCAD: Hello.arx – Step 1 + 2 • ObjectDBX: Structure – Step 3 + 4 • ObjectDBX: Extend it! – Step 5 + 6 • AutoCAD: Multi-Document Environment • Notification System – Step 7

  7. Class Schedule Time 10:00 - 5:00 • Lunch 12:00 - 1:00 Day 1 • Overview of APIs • AutoCAD: Hello.arx Day 2 • ObjectDBX: Structure • ObjectDBX: Extend it! Day 3 • AutoCAD: MDE Environment • Notification System

  8. Training Material • ObjectARX.pptx - this presentation • objectarx_2010_win_64_and_32bit.exe - ObjectARX installation file • Inspector.zip - ObjectARX snoop tool

  9. Agenda Overview of APIs AutoCAD: Hello.arx ObjectDBX: Structure ObjectDBX: Extend it! AutoCAD: Multi-Document Environment Notification System

  10. API Overview A general look at APIs • Types of API • Client/Server interaction • Client code AutoCAD’s APIs and IDEs • Implementation • Comparison

  11. What is an API? A contract, it is about responsibilities • Both sides are (or may be) required to • Implement service entry points • Call services properly Code implementing API can be packaged as • Source code modules (.h/.cpp in C++) • Binary • Static library • DLL • EXE

  12. Client EXE, DLL, script, etc. 4 API ATL templates 2 API 1 API Static MFC Library API Win 32 API DLLs API Packaging 1. Source code 2. Static library 3. DLL 4. EXE SomeApp.exe 3

  13. Client/Server Interaction In process • Client/server is in the same process Local • Client/server is on the same machine Remote • Client/server is on the same network

  14. .ARX .ARX ObjectARX APIs AutoCAD The Plug-In Architecture API is implemented by an exe Client is implemented as a dll .DLL .DLL API .EXE

  15. Forms of Client Code SLOW Interpreted code • Source script • AutoLISP in the past Packaged code (p-code) • Pre-processed, semi interpreted code • Compiled Visual LISP AutoCAD.NET • Compiled into IL Compiled code • Processor instructions • ObjectARX FAST

  16. AutoCAD APIs and IDEs Application Programming Interfaces • ObjectARX • .NET Managed API • COM Automation (VB, Java, Delphi, etc.) • AutoLISP Integrated Development Environments in AutoCAD • Visual LISP • Visual Basic, Applications Edition (VBA) (Visual Studio outside AutoCAD)

  17. API Implementation I AutoCAD Input acquisition Input driver 2D graphics cache (WHIP!) Plotter driver PlotHDI ObjectDBX 3D graphics cache Display driver HEIDI • ObjectARX SDK (free, http://www.autodesk.com/objectarx) • RealDWG (licensed, http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=770257) • Plot DDK (licensed, http://www.autodesk.com/adn-devhelp) • HEIDI DDK (licensed, http://www.autodesk.com/heidi) • Wintab API (free) dwg

  18. API Implementation II .NET COM Client (VB, Java, Delphi) VBA script Lisp script Acdbmgd.dll Acmgd.dll vl.arx acvba.arx axdb.dll ObjectARX APIs COM AutoCAD

  19. Old API Performance Comparison

  20. How to Store Your Data in AutoCAD Different Programming Techniques Data Container Performance Chart Time in seconds

  21. How to Store Your Data in AutoCAD Different Programming Techniques Data Container Performance Chart Time in seconds

  22. How to Store Your Data in AutoCAD Different Programming Techniques Data Container Performance Chart Time in seconds

  23. API Comparison Summary Speed • ObjectARX, .NET is close second, VBA also though obsolete Coverage • ObjectARX, .NET everything except custom objects Ease of use • .NET, VBA Learning curve • .NET, VBA

  24. Agenda Overview of APIs AutoCAD: Hello.arx ObjectDBX: Structure ObjectDBX: Extend it! AutoCAD: Multi-Document Environment Notification System

  25. AutoCAD: Hello.arx ObjectARX • What it is • Where to get it ObjectARX applications • Structure • Loading • Memory management Creating commands • Command mechanism • Prompting for user input ObjectARX Wizards

  26. What is ObjectARX? AutoCAD Runtime eXtension • A DLL plug-in model • A set of Object Oriented C++ libraries • A framework A framework? • More than just a toolkit • Specialized objects can be plugged back into the system • Custom entities • Reactors • ...

  27. What can I do with ObjectARX? Modify and extend the drawing database • Create/modify/erase objects • Create new types of objects Modify AutoCAD’s user interface • Commands • Toolbars/dialogs • Properties Window • Design Center • Display system Monitor/Modify AutoCAD’s standard behavior • Event notifications • Input point acquisition

  28. Getting the ObjectARX SDK Download - Free On Autodesk public web site Developer Center - ObjectARX (http://usa.autodesk.com/adsk/servlet/index?id=773204&siteID=123112) Or Search for ObjectARX on http://www.autodesk.com/

  29. Binary compatibility ObjectARX 2010 • AutoCAD 2010 • Binary incompatible with earlier releases ObjectARX 2009 • AutoCAD 2009 ObjectARX 2008 • AutoCAD 2008 and 2009 ObjectARX 2007 • AutoCAD 2007, 2008 and 2009 • Binary incompatible with earlier releases ObjectARX 2006, 2005,2004… • Not supported, as well as AutoCAD versions older than 2007

  30. Development Environment For ObjectARX development • Microsoft Visual Studio 2008 SP1 ObjectARX 2010 SDK Microsoft Windows 2000 SP2 or better

  31. ObjectARX SDK Contents What comes with the SDK • Libraries and Header Files • Documentation • Samples • Utilities

  32. Main Libraries - I AcRx Object and Class Management (rxapi.lib) AcEd AutoCAD Editor Facilities (acedapi.lib) AcDb AutoCAD Database (acdb18.lib) AcGi AutoCAD Graphics Interface (acgiapi.lib) AcGe AutoCAD Geometry Library (acge18.lib) 32- and 64-bit versions: C:\ObjectARX 2010\lib-win32 and C:\ObjectARX 2010\lib-x64

  33. Main Libraries - II AcUi/AdUi MFC Extension Library (adui18.lib acui18.lib) Automation (axdb.lib oleaprot.lib) ads_ Function Set (acad.lib) Static Linking Memory Management (rxheap.lib)

  34. Utilities AutoCAD Facet Modeler (aecmodeler60.lib) AutoCAD Boundary Representation (acbr18.lib, acgex19.lib) ObjectARX Wizard (<your path>\ObjectARX 2010\utils\ObjARXWiz\ArxWizards.msi) ATIL - Raster graphics Teefy - Converting existing applications to Unicode string handling

  35. On-line Documentation Found in ObjectARX\docs • ObjectARX Documentation (arxdoc.chm) • ObjectARX Developers Guide (arxdev.chm) • Reference Manual (arxref.chm) • Managed Class Reference Guide (arxmgd.chm) • What's New (arxwhnew.chm) • Migration Guide (arxmgr.chm) • Interoperability Guide (arxiop.chm) • ObjectARX Readme (readarx.chm) ObjectARX Training Material and Labs (ObjectARX\arxlabs\ObjectARXLabs.chm)

  36. Samples The ObjectARX SDK comes with a number of code samples organized into sub-categories: • ObjectARX\Samples • COM • Database • DotNet • Editor • Entity • Graphics • Misc • Reactors • PolySamp and ArxDbg Also see Knowledgebase on the ADN website.

  37. acrxEntryPoint • acrxGetApiVersion .ARX .ARX ObjectARX APIs AutoCAD .ARX = .DLL + 2 exported functions .DLL .DLL API .EXE

  38. Loading ObjectARX Applications I Loaded by the user • ARX & APPLOAD commands • Drag & Drop Demand loaded • Startup • acad.rx file • Registry • (arxload) in acad.lsp • On command invocation • Registry • On request • From another application • On proxy detection • Registry Live Enablers (see PolySamp)

  39. 3. 5. 4. 6. 1. 2. Loading ObjectARX Applications II AutoCAD .ARX Rxapi.lib CRT Operating System 1. LoadLibrary 2. _DllMainCRTStartup (see MSDN for info) 3. CRT_INIT (constructs global class vars) 4. DllMain (see MSDN for info) 5. acrxGetApiVersion 6. acrxEntryPoint

  40. 3. 2. Piece of Memory CRASH! 1. Wrong ARX Memory Management AutoCAD/ObjectDBX MSVCRT.DLL .ARX MSVCRTD.DLL 1. .ARX allocates memory from debug heap 2. .ARX passes allocated memory to AutoCAD 3. AutoCAD de-allocates it with release ‘delete’… CRASH

  41. 1. .ARX allocates memory from release heap 2. .ARX passes allocated memory to AutoCAD 3. AutoCAD de-allocates it with release ‘delete’…  OK 3. Piece of Memory 2. 1. Correct ARX Memory Management I AutoCAD/ObjectDBX MSVCRT.DLL .ARX

  42. 1. .ARX allocates memory via rxheap.lib 2. AutoCAD allocates memory on release heap 3. .ARX passes memory to AutoCAD 4. AutoCAD de-allocates it with release ‘delete’…  OK 2. 4. Piece of Memory 1. 3. Correct ARX Memory Management II AutoCAD/ObjectDBX MSVCRT.DLL .ARX Rxheap.lib Libcmt.lib

  43. Getting Started Visual C++ 9.0 (.NET) AutoCAD 2010 ObjectARX 2010 ArxDbg \ObjectARX 2010\samples\database\ARXDBG Dependency Walker www.dependencywalker.com or C:\Program Files\Microsoft Visual Studio 9\Common7\Tools\bin\depends.exe Process Monitorwww.sysinternals.com

  44. 1. 4. 5. 2, 3. 6. AcEdCommand Command Mechanism I .ARX AcEdCommandStack Callback function AutoCAD 1. Add command 2. Create command object 3. Parameterize it 4. User types command name 5. Lookup command object 6. Call callback function

  45. Command Mechanism II Removing commands is as important as adding them Command names can clash • Commands belong to groups Command groups must be unique • Registered Developer Symbol (RDS) • Search for “Registered Developer Symbol” takes you to http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=1075006

  46. Lab - Step 1 Setup your first .ARX

  47. Prompting for User Input AcEd functions • String, number acquisition acedGetString(), acedGetInt() • Point, angle acquisition acedGetPoint(), acedGetAngle() • Entity selection acedEntSel() Full range of Win32 controls

  48. ObjectARX 2010 Wizards Application Wizard • ObjectARX\utils\ObjARXWiz\ArxWizards.msi • COM Wrapper Wizard • Custom Object Wizard • Reactors Class Wizard etc. Visual Studio Add-In • ObjectARX Commands • Autodesk Class Explorer etc.

  49. Lab - Step 2 Play around with user input functions

  50. Agenda Overview of APIs AutoCAD: Hello.arx ObjectDBX: Structure ObjectDBX: Extend it! AutoCAD: Multi-Document Environment Notification System

More Related