Changing sheet print order - auto PDF print

Changing sheet print order - auto PDF print

jbrown
Explorer Explorer
978 Views
5 Replies
Message 1 of 6

Changing sheet print order - auto PDF print

jbrown
Explorer
Explorer

I have modified the autopdf print plugin found at http://thebuildingcoder.typepad.com/blog/2013/06/auto-pdf-print-from-revit-2014.html

 

I have it running pretty well, the only thing bugging me is I have not found a way to change the order of the sheets printed. 

 

It prints everything in alphabetical order, which is good, the only problem is with the GSN sheets that I want to print first, but they usually end up a few sheets back.  Changing the sheet naming is not an option.

 

Is there a way to change the print order?

 

I thought this would have worked: 'SExxx' is the GSN sheet name, so I insert them first, then loop through again and add everthing not 'SExxx'

 

ViewSet myViewSet = new ViewSet();
                string match = "SE";

                foreach (ViewSheet vs in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>().OrderBy( e => e.SheetNumber).Where(q => q.SheetNumber.Contains(match)))
                {
                    myViewSet.Insert(vs);
                }

                foreach (ViewSheet vs in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>().OrderBy( e => e.SheetNumber).Where(q => !q.SheetNumber.Contains(match)))
                {
                    myViewSet.Insert(vs);
                }



Which does loop through the sheets correctly, but does not have an effect on the print order. I'm kinda stuck right now, any advice appreciated.

 

0 Likes
979 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

Dear Jbrown,

 

I am very glad that you found the Auto PDF Print add-in useful and were able to modify it for your needs.

 

Would you like to share your enhancements with the rest of the community?

 

I could create a GitHub repository for the project and update it to Revit 2015 and 2016, and then you could add your enhancements there, if you like.

 

What do they consist of?

 

To address your question:

 

I am afraid that the suggestion you make cannot work.

 

You are inserting the sheets into a ViewSet collection.

 

As the name implies, it is a set, i.e., an unordered collection.

 

Therefore, you have no control over the order of its elements.

 

One way to control the order in which the set elements are processed might be to create separate sets for the elements in the order you want them printed, and submit them as separate print jobs.

 

I have not looked in detail, though, so there may very well be other, and better, approaches.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 6

jbrown
Explorer
Explorer

Thanks for the reply, I was afraid that would be the answer.

 

The idea of creating two PDFs is interesting though, I can look into that and see about automating a merge. 

 

I am happy to share my code, here is a list off the top of my head of changes I have made:

 

Changed the printer to bluebeam

Check the file modified date, and only create pdfs where the revit file has been modified in the last 24 hours

Check to make sure the file is being opened in the correct version of revit

Removed the output pdf folder input from the config file, and only write to a 'currentpdf' subfolder from the central revit file

unloads all linked files, except those listed in the config file (comma separated arguments)

unloads worksets that do not match a specific regex. "(\.*structural\.*|\.*workset\.*|\.*scope.boxes\.*|\.*precast\.*)"

If the workset defined in the config file does not exist, it adds all sheets starting with "S"

If the workset defined does not match "Set", it appends the workset name to the PDF file (we have a few jobs that have multiple sets)

If the PDF file is open, and not writeable, the date is appended to the PDF file

 

 

I also had some issues with dialog boxes showing up on file open.  I didn't look into handling these within Revit, although it is probably possible.  Instead I went straight to a quick and dirty AutoIT script to handle them.

 

Keep in mind I am not a developer, or a drafter, just the IT guy tasked with this project.  My code mostly works, but it may not be pretty

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk

Dear Jbrown,

 

Thank you for the answer and list of enhancements.

 

What version of Revit are you working with?

 

I cannot really tell whether these modifications would be of interest to others.

 

However, the fact that you went to the effort to reuse this code does indicate that it might be useful for others as well, in which case it might be worthwhile for me to put it on GitHub and migrate to the newer versions...

 

Hmmm.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 6

jbrown
Explorer
Explorer

So far, I have this running for Revit Structure 2014 and 2015, and I'm sure 2016 is coming soon.

 

Yes, these changes are customized for our environment and needs, but we are structural and engineers like to have up to date review sets, they don't (generally) want architectural, mechanical, electrical, etc in these PDFs.  The larger changes I made were related to this.

 

As for if anyone else is interested in these changes, I couldn't say.  I do know there is commercial software available that does basically this same thing.

 

 

0 Likes
Message 6 of 6

jeremytammik
Autodesk
Autodesk

Thank you for the clarification.

 

Ok, let's wait and see what people say...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes