Includes set and save in Publish Setting

Includes set and save in Publish Setting

khagesh_mahajan
Participant Participant
481 Views
1 Reply
Message 1 of 2

Includes set and save in Publish Setting

khagesh_mahajan
Participant
Participant

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.

khagesh_mahajan_1-1721915610562.png

 


Here how could I 'include' this set (here named AnalyticalModelSet) and then 'save & close' using the API?

0 Likes
482 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

You can read about C4R Publish View to Cloud API and see how add your vote to the Revit Idea Station wishlist item here:

   

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes