Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

create schedule of views visible within a plan view

5 REPLIES 5
Reply
Message 1 of 6
ram
Participant
433 Views, 5 Replies

create schedule of views visible within a plan view

 

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?

 

5 REPLIES 5
Message 2 of 6
Joe.Ye
in reply to: ram

 

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
Message 3 of 6
ram
Participant
in reply to: Joe.Ye

Thanks

 

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

Message 4 of 6
Joe.Ye
in reply to: ram

 

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
Message 5 of 6
ram
Participant
in reply to: Joe.Ye

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.
Message 6 of 6
Joe.Ye
in reply to: ram

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community