Download presentation
Presentation is loading. Please wait.
Published byAvis Payne Modified over 9 years ago
1
© 2011 Autodesk CP417-7 - Leveraging ActiveX® Libraries with AutoLISP® Lee Ambrosius – Autodesk, Inc. Sr. Technical Writer – PSEB User Assistance
2
© 2011 Autodesk Where Am I and Who Should Be Here You are in session: CP417-7 - Leveraging ActiveX® Libraries with AutoLISP® You should know: AutoCAD 2012 (or AutoCAD 2007 and later) Basics of AutoLISP
3
© 2011 Autodesk Overview This session will help you get more out of AutoLISP. In this session, you will learn to: Access objects in an open or closed drawing Access and store values in the Windows® Registry Learn about reactors Manipulate the Windows environment Drive Microsoft® Office applications; Word, Excel, and Access
4
© 2011 Autodesk Who Am I? My name is Lee Ambrosius AutoCAD user for over 16 years; started on R12 DOS Customizing and programming on AutoCAD for 15 years Sr. Technical Writer at Autodesk for AutoCAD/AutoCAD LT/AutoCAD for Mac Contributing Author and Technical Editor of many AutoCAD related books and articles AutoCAD for Dummies AutoCAD and AutoCAD LT Bible Series Mastering AutoCAD for Mac AUGI HotNews and AUGIWorld
5
© 2011 Autodesk Session Rules A few rules for this session: Silent your cell phone If you have to leave at anytime, please do so quietly I will allow time to ask questions during the session unless we start getting behind Thanks for Your Cooperation
6
© 2011 Autodesk Access Open and Closed Drawings The AutoCAD COM libraries allow you to work with open or closed drawing. vl-load-com loads the Visual LISP functions which are part of acax18enu.tlb Accessing drawings not loaded into AutoCAD is accomplished with axdb18enu.tlb The COM libraries allow you to: Create and modify objects in model or paper space Work with named objects, such as layers and blocks Open and work with a drawing in memory
7
© 2011 Autodesk Access Open and Closed Drawings Create a circle with Visual LISP CreateCircle-VL Change the some object properties to ByLayer for all objects in the current space Change2ByLayer Access a drawing not open and copy its dimension styles to the current drawing AccessExternalDrawing
8
© 2011 Autodesk Access and Store Information for Use Later You can store values in different ways based: Global variables can hold information while a drawing remains open Windows Registry allows you to store information that can be accessed across and between different sessions of AutoCAD Xdata, Xrecords, and custom dictionaries can be stored in a drawing and accessed when a drawing is opened the next time
9
© 2011 Autodesk Access and Store Information for Use Later Read from and write to the Windows Registry WinReg Assign and read xdata to an object in a drawing SetXdata-VL and RemoveXdata-VL ListXdata Work with custom dictionaries CreateDictionary-VL and DeleteDictionary-VL PrintXrec-VL
10
© 2011 Autodesk Monitor Activity in AutoCAD with Reactors Reactors watch for and react to certain situations to occur in a drawing, to an object, or at the application level. Some of the basic reactors that are available: VLR-Editor-Reactor VLR-Command-Reactor VLR-Lisp-Reactor Reactors in action: Using a command reactor to monitor the creation of hatch objects Using an editor reactor to plot a DWF file of the current drawing being closed
11
© 2011 Autodesk Work with Windows through AutoLISP The Windows Scripting Object allows you to access and manipulate the Windows environment in many different ways. Identify installed printers Obtain information about network and local drives Access hardware on the current machine List special folders and files on the local machine Use user and machine specific environment variables
12
© 2011 Autodesk Work with Windows through AutoLISP Harness the power of Windows: Work with the Windows shell and special folders CreateDesktopShortcut Access and write to environment variables ExpEnvStr GetEnvStr SetEnvStr
13
© 2011 Autodesk Work with Microsoft Office With the Microsoft Office COM libraries you work with: Word and DOC/DOCX document files Excel and XLS/XLSX spreadsheet files Access and MDB database files Among much more…
14
© 2011 Autodesk Work with Microsoft Office Pass and get information to and from Microsoft Office applications: Work with Word PrintMSWordDoc CreateMSWordDoc Work with Excel ExtractDrawingToExcel UpdateDrawingFromExcel Work with an Access MDB file using DAO or ADO AccessDatabase
15
© 2011 Autodesk Not ActiveX Related, but New to AutoCAD 2012 (Win/Mac) AutoCAD 2012 introduced four new functions that allow you to emulate methods of the COM library. The new functions are: dumpallproperties - Outputs all the properties and their current value for the specified entity getpropertyvalue - Returns the current value of the specified property for an entity ispropertyreadonly - Returns T or nil of the specified property for an entity is read- only or not setpropertyvalue - Sets the specified property to a new value for an entity
16
© 2011 Autodesk Final Questions… ??? Going Once… Going Twice…
17
© 2011 Autodesk Closing Remarks Thanks for choosing this session, and do not forget to complete the evaluation. If you have any further questions, I can be reached at: email: lee.ambrosius@autodesk.com twitter: http://twitter.com/leeambrosius Enjoy the rest of the conference.
18
© 2011 Autodesk Autodesk, AutoCAD* [*if/when mentioned in the pertinent material, followed by an alphabetical list of all other trademarks mentioned in the material] are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document. © 2011 Autodesk, Inc. All rights reserved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.