1 / 21

CP318-4 : Taking a Look at the Sheet Set Object With VB.NET

CP318-4 : Taking a Look at the Sheet Set Object With VB.NET. Lee Ambrosius Autodesk, Inc Sr. Technical Writer. Where Am I and Who Should Be Here. You are in session: CP318-4 - Taking a Look at the Sheet Set Object With VB.NET

anisa
Télécharger la présentation

CP318-4 : Taking a Look at the Sheet Set Object With VB.NET

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. CP318-4: Taking a Look at the Sheet Set Object With VB.NET Lee Ambrosius Autodesk, Inc Sr. Technical Writer

  2. Where Am I and Who Should Be Here You are in session:CP318-4 - Taking a Look at the Sheet Set Object With VB.NET If you want to manipulate sheet sets through programming (not the Sheet Set Manager), you are in the right place. You should know or have the following to get the most out of this session: • Experience with AutoCAD 2010 (or AutoCAD 2008 and 2009) • Can create drawing templates and understand Sheet Sets • Know VB.NET (or C#)

  3. Overview AutoCAD ships with a COM library that allows you to access and manipulate the objects stored in a Sheet Set (DST) file. In this session, you will learn how to: • Access the COM Sheet Set object • Manipulate sheet set files The COM Sheet Set object is a great way to: • Create custom properties • Insert or manage drawing layouts • Populate fields from an external data source

  4. Who Am I? My name is Lee Ambrosius • Started with AutoCAD R12 DOS, over 15 years ago • Technical Writer at Autodesk for AutoCAD and AutoCAD LT (Worked on the Customization and .NET Developer’s Guides) • Author of AutoCAD related books and articles • AutoCAD 2009 and AutoCAD LT 2009 All-in-one Desk Reference for Dummies • AutoCAD 2008 3D Modeling Workbook for Dummies • AUGI World and AUGI Hotnews • White Papers for Autodesk

  5. Session Rules A few rules for this session: • Turn off or set your cell phone to vibrate • If you have to leave at anytime, please do so quietly • I will allow time to ask questions during the session Thanks for Your Cooperation

  6. What is Going to be Covered • What is the Sheet Set Object? • How to find and reference the Sheet Set Object • Create and access a sheet set • Work with subsets and sheets • Create custom properties for a sheet and sheet set • Work with events for the Sheet Set Object

  7. What is the Sheet Set Object? The Sheet Set Object is a COM library which allow you to manipulate sheet sets. There are five objects you need to know: • AcSmSheetSetMgr – Open and create sheet set databases, and find out which ones are open • AcSmDatabase – Used to access the objects in a sheet set • AcSmSheetSet – Reference to the object that contains the subsets and sheets of a sheet set • AcSmSubset – Reference of a subset • AcSmSheet – Reference of a specific drawing layout

  8. Finding the Sheet Set Object The Sheet Set Object is contained in AcSmComponents18.lib. • Located in C:\Program Files\Common Files\Autodesk Shared • The library that is used for AutoCAD 2010, is similar to the original library that shipped with AutoCAD 2005.

  9. Referencing the Sheet Set Object To use the Sheet Set Object, you must add a reference to it in your Microsoft Visual Studio project. To reference the object, do the following: • Click Project menu >> Add Reference. • In the Add Reference dialog box, COM tab, select “AcSmComponents18 1.0 Type Library”. • Click OK.

  10. Referencing the Sheet Set Object After you reference “AcSmComponents18 1.0 Type Library”, you need to use the Imports statement in order to use the Sheet Set object in your project. The Imports statement will look like: Imports ACSMCOMPONENTS18Lib

  11. Working with the Sheet Set Manager The Sheet Set Manager Object allows you to: • Step through the open sheet set database (GetDatabaseEnumerator) • Open a sheet set database (OpenDatabase) • Find an open sheet set database (FindOpenDatabase) • Create a sheet set database (CreateDatabase) • Close a sheet set database (Close and CloseAll) • Setup event handlers (Register and Unregister)

  12. Working with the Sheet Set Manager The following syntax shows how to reference the Sheet Set Manager object: ' Get a reference to the Sheet Set Manager object DimsheetSetManagerAsIAcSmSheetSetMgr sheetSetManager = NewAcSmSheetSetMgr

  13. Working with a Sheet Set The Sheet Set object is a container for sheets, subsets, views, and properties. Before you learn how to work with the Sheet Set object, there are two important things you need to know: • A database must be locked before you edit it (Lockdb) • After editing, the database needs to be unlocked (Unlockdb) Prior to locking or unlocking a database, you should check its current lock status (GetLockStatus). Use the returned status to determine if the database is locked or unlocked.

  14. Working with a Sheet Set Now that you know how to lock and unlock the sheet set, you can do the following with the Sheet Set object: • Add and remove a sheet (AddNewSheet and RemoveSheet) • Import a sheet (ImportSheet) • Add and remove a subset (CreateSubset and RemoveSubset) • Work with sheet set properties • Add new custom properties (GetCustomPropertyBag) • Modify standard properties (GetProjectName and SetProjectName) • Prompt for DWT file (GetPromptForDWT and SetPromptForDWT) • Setup event handlers (Register and Unregister)

  15. Working with Subsets The Subset object references an organizational container in a Sheet Set. You can do the following with a Subset object: • Add and remove a sheet (AddNewSheet and RemoveSheet) • Import a sheet (ImportSheet) • Add and remove a subset (CreateSubset and RemoveSubset) • Step through the sheets in a subset (GetSheetEnumerator) • Work with the properties of the subset • Prompt for DWT (GetPromptForDwt and SetPromptForDwt) • New sheet location (GetNewSheetLocation and SetNewSheetLocation)

  16. Working with Sheets The Sheet object references a single drawing layout. You can do the following with a Sheet object: • Change the referencing layout (GetLayout and SetLayout) • Set a sheet to be plotted (GetDoNotPlot and SetDoNotPlot) • Work with properties of the sheet • Add new custom properties (GetCustomPropertyBag) • Modify standard properties • Title (GetTitle and SetTitle) • Revision Date (GetRevisionDate and SetRevisionDate) Note: After adding a custom sheet property, it needs to be appended to all existing sheets in the sheet set

  17. Other Objects to Know • AcSmResources – Drawing resources • AcSmAcDbLayoutReference – Drawing layout • AcSmCustomPropertyBag – Container for custom sheet and sheet set properties • AcSmFileReference – Resource file, drawing or drawing template • AcSmAcDbBlockRecordReference – Block contained in a drawing or drawing template • AcSmCalloutBlocks – Callout blocks collection • AcSmPublishOptions – Publish options • AcSmSheetSelSet and AcSmSheetSelSets – Sheet set selections

  18. Where to Get More Information Learning a feature can be a challenge, but you do not have to go it alone. The following are only but only a few resources that you can use after leaving here: • Help system in AutoCAD • AUGI Forums (www.augi.com) • Autodesk Discussion Forums (www.autodesk.com) • Industry Events/Classes (AU, AUGI CAD Camp and ATCs)

  19. Final Questions Questions Going Once… Going Twice…

  20. Closing Remarks Thanks for choosing this session, and do not forget to fill out the evaluation for this session If you have any further questions, I will be around for the week and can be reached at: lee.ambrosius@autodesk.com Enjoy the rest of the conference.

More Related