I started digging into the world of Sheet Sets with VB.NET last week.
I am OK at coding, but don't do a ton of it, nor am I very proficient in VB.NET.
I've got more experience with Lisp, but as I started digging into the Sheet Set Manager stuff I realized that .NET would be the best way to go.
My ultimate goal is to have a program that automatically numbers all my sheets.
I have code that works, but the problem is, it requires the sheet set to be setup such that the disciplines are in a certain order, and I'll show you why.
My code grabs a sheetset database, then I use an enumerator on it to go through all the items like so:
Do While Not itemSheetSet Is Nothing
'Increment the counter if the object is a sheet
If itemSheetSet.GetTypeName() = "AcSmSheet" Then
nSheetCount = nSheetCount + 1
sheet = itemSheetSet
sheetProps = sheet.GetCustomPropertyBag
SheetNumCode = sheet.GetNumber
SheetNameList.Add(SheetNumCode)
End If
itemSheetSet = enumerator.Next()
Loop
This builds a list with all the Sheet Codes (drawing #s).
But the order in which these are stored in the database object seems to be random so I have a jumbled list of drawing #s.
I then had to write some code to sort out my list so I could rebuild it in order with "G-" sheets first, then "D-" sheets, then "C-", etc.
The problem is, we have some jobs that don't follow the same discipline layout.
For instance, some jobs will group drawings into subsets based on building or location.
After that longwinded explanation, it really boils down to this:
How do I get AutoCAD to give me the list of sheets in the same order that you see them in the sheet set manager?
I wouldn't think it would be so difficult since AutoCAD has to display them to the user in that order so it's got to be in there somewhere, right?