Escolar Documentos
Profissional Documentos
Cultura Documentos
Wayne
Brill
Wayne has been a member of Autodesk Developer Technical services supporting ADN (Autodesk Developer Network) for nine years. Currently, Wayne provides API support for Autodesk Inventor, AutoCAD, AutoCAD Mechanical, AutoCAD OEM, and RealDWG.
Areas of focus
AutoCAD .NET
Namespaces
AutoCAD .NET
ObjectARX Wizard will install wizards for creating VB.NET and C# applications in VS 2008 ObjectBrowser will help to explore the available classes Use transactions to open objects
A transaction can be committed, aborted or disposed.
Call dispose in finally block (in VB) or use the using keyword
AutoCAD .NET
AutoCAD .NET
LispFunction attribute
Name space
Demo
Create a New Project and call a .NET function from AutoLISP
ResultBuffer
Autodesk.AutoCAD.DatabaseServices.ResultBuffer
TypedValue
TypedValue.TypeCode is a 16-bit integer value Indicates the data type TypedValue.Value value must be the type indicated by TypeCode Use LispDataType to define value types
LispDataType
Defines identifiers that represent the data types passed through AutoLISP ResultBuffer arguments.
LispDataType Fields
_atom,Nil,DottedPair, ListEnd, ListBegin Point3d, Orientation, ObjectId, Angle Point2d, None, SelectionSet, Void Int32,Int16, Double, Text
Pass arguments to a .NET function change them and return the data to the LISP function Return a SelectionSet
Return a selected entity
Add a form to the project with the controls you need to gather the input from the user Create a LispFunction that will display the form When the user dismisses the form get the input the user entered on the form Send the input the user entered back to the calling function in a ResultBuffer
ObjectARX and AutoCAD .NET get the priority for new functionality AutoLISP and COM are usually not updated with new features Need to migrate applications to these new languages or find a way to use these new features from AutoLISP.
ObjectARX and AutoCAD .NET allow you to programmatically set these overrides
COM and AutoLISP do not support this
(unable to automate using command function)
AutoLISP & .NET to set layer viewport overrides AutoLISP & .NET to set the viewport annotation scale
Platform Invoke to access APIs not wrapped by the AutoCAD .NET API
acedGetSym
get AutoLISP variables
acedInvoke
Run AutoLISP functions from .NET
Platform Invoke
DllImport
Available from InteropServices
acedGetSym
Use P/Invoke to get and set LISP variables. Use P/Invoke to run an AutoLISP function.
Summary
NET API to access new features not available in AutoLISP P/Invoke to access APIs not wrapped by the .NET API
AutoCAD .NET Training (classroom) http://www.autodesk.com/apitraining Through the Interface blog - Site focuses on .NET http://blogs.autodesk.com/through-the-interface Information about Autodesk Developer Network www.autodesk.com/joinadn
Members-only website with 1000s of technical articles Unlimited technical support Product direction through conferences Marketing benefits
www.autodesk.com/joinadn
DevLab
San Francisco, USA Feb 1-5, 2010 Farnborough, UK Feb 8-12, 2010 Munich, Germany June 7-11, 2010 Other countries TBD
Q&A
Thank You