create schedule of views visible within a plan view

create schedule of views visible within a plan view

ram
Participant Participant
547 Views
5 Replies
Message 1 of 6

create schedule of views visible within a plan view

ram
Participant
Participant

 

I want to create a schedule that will show which views are visible within a Revit 2012-2013 plan view. Does anyone know how to extract this data from the revit model to a schedule or external data file?

 

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

Joe.Ye
Alumni
Alumni

 

This can be done via Revit API. You can retrieve the list of the views visible in a view via the following code fragment.

 

<code>

FilteredElementCollector collector = new FilteredElementCollector(doc,doc.ActiveView.Id);
            collector.OfCategory(BuiltInCategory.OST_Viewers);
            
            string elementMessage = null;
            foreach(Element elem in collector)
            {
                if(elem.Category !null)
                    elementMessage += elem.Name + ";; category=" + elem.Category.Name + "\r\n";
            }
            
            TaskDialog.Show("number of elemetn",collector.ToElementIds().Count.ToString() + "\r\n" + elementMessage);

<code>

 

You can write the list of the view visible int the specified view to external data source, for example, txt file, excel spreadsheet via the non-Revit APIs.

 

With regard to create a Revit Schedule, I didn't try that for this question. I think it should be possible to create for the visible views in the plan view. Revit 2013 exposed the API to create schedule, you can set filter for the schedule.

 

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 6

ram
Participant
Participant

Thanks

 

Do have any ideas to add the sheet # and detail # as well as the sheet reference name to this output?

0 Likes
Message 4 of 6

Joe.Ye
Alumni
Alumni

 

I am not quite sure I got your idea. Would you please clarifiy it in detail? Thanks.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 5 of 6

ram
Participant
Participant
Once you place the view on a sheet to print it, it is given a # (detail number) and it is noted to be placed on that sheet (sheet number). I would like to get these two parameter information along with the view name and/or sheet view name.
0 Likes
Message 6 of 6

Joe.Ye
Alumni
Alumni

Yes, you can get the sheet number and reference sheet and detail # from the view sheet object's parameter value.  The way to get these parameter value is first get the target parameter object. Then read the parameter value from those target parameter.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes