Section view object

Section view object

Anonymous
Not applicable
1,003 Views
2 Replies
Message 1 of 3

Section view object

Anonymous
Not applicable

Hello!
Could you help me please? I started to learn Revit API and I'm developing a plugin using Revit API and C#.
I have a view section of any object. For example its pipe. How can I get some information about section via API? Some parameters, coordinates of section?
Thanks!

0 Likes
Accepted solutions (1)
1,004 Views
2 Replies
Replies (2)
Message 2 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous,

 

String s="";
FilteredElementCollector COLLECTOR = new FilteredElementCollector(doc).OfClass(typeof(ViewSection)); ICollection<Element> ViewsectionS = COLLECTOR.ToElements() as ICollection<Element>; if(ViewsectionS.Count()!=null) { foreach (ViewSection vs in viewsectionS) { if(vs.Name=="Your section name") { foreach(Parameter p in vs.Parameters) { s = s + "\n" + p.Definition.Name + "_____" + p.AsValueString(); }
} } } TaskDialog.Show("Section Parameters", s);

This code will list out section parameters.

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you! But the cut (as a species) does not have a coordinate parameter. I need to know the location of the cut relative to the base point of the project.

0 Likes