Author Topic: Sheet Set Manager || Getting the sheets in order  (Read 3149 times)

0 Members and 1 Guest are viewing this topic.

lkaervek

  • Guest
Sheet Set Manager || Getting the sheets in order
« on: May 29, 2014, 01:17:09 PM »
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:

Code - vb.net: [Select]
  1. Do While Not itemSheetSet Is Nothing
  2.    'Increment the counter if the object is a sheet
  3.    If itemSheetSet.GetTypeName() = "AcSmSheet" Then
  4.       nSheetCount = nSheetCount + 1
  5.       sheet = itemSheetSet
  6.       sheetProps = sheet.GetCustomPropertyBag
  7.       SheetNumCode = sheet.GetNumber
  8.       SheetNameList.Add(SheetNumCode)
  9.    End If
  10.    itemSheetSet = enumerator.Next()
  11. Loop
  12.  

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?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Sheet Set Manager || Getting the sheets in order
« Reply #1 on: June 05, 2014, 05:29:37 PM »
I will look for it but there is a command that just grabs sheets and also subsets I think and returns them in same order as UI

lkaervek

  • Guest
Re: Sheet Set Manager || Getting the sheets in order
« Reply #2 on: June 06, 2014, 06:56:39 AM »
Jeff H, that would be awesome if such a command does exist.  I have yet to come across it.
That would definitely save me a lot of coding headache if I could just cycle through each sheet as it appears in the UI.

DavidG

  • Guest
Re: Sheet Set Manager || Getting the sheets in order
« Reply #3 on: July 08, 2015, 03:40:28 PM »
Hey Everyone, I was back checking are there any examples of using COM to reorder the sheets?
thanks
dg

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Sheet Set Manager || Getting the sheets in order
« Reply #4 on: July 08, 2015, 04:05:57 PM »
No idea if this will help or not, but there is a link on this page to some source code that contains a function to reorder the sheets in SSM.

http://style.civil3dreminders.com/civil3dreminderspack



BlackBox

  • King Gator
  • Posts: 3770
Re: Sheet Set Manager || Getting the sheets in order
« Reply #5 on: July 09, 2015, 08:56:52 AM »
No idea if this will help or not, but there is a link on this page to some source code that contains a function to reorder the sheets in SSM.

http://style.civil3dreminders.com/civil3dreminderspack

Great find, RK - thanks for sharing. :-)
"How we think determines what we do, and what we do determines what we get."