It is great to see people are starting to use AutoCAD 2005, only days after it has started to ship. However, there have been many questions in the area of Sheet Sets of how to do certain things. One of these issues is how to get a Total Number of the Sheets in a Sheet Set and then use that number in a Field. There is no built in value for this, but you can use a custom property. Now that leads to manual work, so during my lunch hour I decided to tackle how to use the new Sheet Set API. I have a pretty good handle on the API, but there could be some improvements in the code that I am about to post. The improvement that I am looking at is the ability to use events that SheetSets have. Maybe, next lunch hour.
' Written by Lee Ambrosius
' Date: 3/24/04
' Program is provided AS-IS with no expressed written warranty
' This example demonstrates a couple of the new SheetSet API and some of its
' many properties and methods
' It creates a custom property at the Sheet Set level called "Total Sheets"
To use it follow the directions below after the file has been downloaded and unzipped.
1. Drag 'n drop the DVB module or use APPLOAD to load the project file
2. Start VBAMAN click on the Macros button and select the macro called basSheetCount.SetSheetCount
3. Click the run button
You should see the custom property added to the SheetSet. I see that Events can be trapped from Sheet Set Manager so I am going to look into that as a future change. Let it will be just a mater of loading the module and it should take care of recounting Automatically.
Hope you find value in the routine above.