Message 1 of 2
Includes set and save in Publish Setting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
For including set in publish setting, I am able to create new set and added the views to that particular set.
Here is the code for creating and adding views to it.
Document doc = this.ActiveUIDocument.Document;
List<Element> views = new FilteredElementCollector(doc).OfClass(typeof(View)).WhereElementIsNotElementType().Where(v => v.Name.Contains("Analytical")).ToList();
ViewSet myViewSet = new ViewSet();
foreach (View v in views) {
myViewSet.Insert(v);
}
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("AnalyticalModelSet");
}
catch (Exception ex)
{
TaskDialog.Show("Error", ex.Message);
}
transaction.Commit();
}
Here is the screenshot after code run.
Here how could I 'include' this set (here named AnalyticalModelSet) and then 'save & close' using the API?
Developer Advocacy and Support +