- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hope someone can help?
Im working in Revit 2018 in c# and I am trying to create a ViewSheetSetting and I for what ever reason am missing what I am sure is the obvious.
My basic code is:
Document doc = m_printData.commandData.Application.ActiveUIDocument.Document;
ViewSet myViewSet = new ViewSet();
foreach (ViewSheet vs in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)))
{
myViewSet.Insert(vs);
}
PrintManager printMgr = doc.PrintManager;
printMgr.PrintRange = Autodesk.Revit.DB.PrintRange.Select;
ViewSheetSetting viewSheetSetting = printMgr.ViewSheetSetting;
viewSheetSetting.CurrentViewSheetSet.Views = myViewSet;
using (Transaction transaction = new Transaction(doc, "NewSheetSet"))
{
transaction.Start();
try
{
viewSheetSetting.SaveAs("Test");
}
catch (Exception ex)
{
transaction.RollBack();
}
transaction.Commit();
}
I hope someone can put me out of my misery and show me were I have gone wrong.
Thanks in advance.
Solved! Go to Solution.