Message 1 of 3
Revit API. Work with the form in VS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good afternoon!
created a class- SortLevels
public class SortLevels : IExternalCommand
{
public bool IsTemplate { get; private set; }
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIDocument uiDoc = commandData.Application.ActiveUIDocument;
Document doc = uiDoc.Document;
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> levels = collector.OfCategory(BuiltInCategory.OST_Views).Where(x => !(x as Autodesk.Revit.DB.View).IsTemplate
&& (x as Autodesk.Revit.DB.View).ViewType != ViewType.Elevation
&& (x as Autodesk.Revit.DB.View).ViewType != ViewType.ThreeD
&& (x as Autodesk.Revit.DB.View).ViewType != ViewType.Section).ToList();
as an example, displays the following kinds of levels.
Can you tell me, how to get the class into the form? How can this collector be inferred in the form in checkedListBox1
private void checkedListBox1_SelectedIndexChanged_1(object sender, EventArgs e)
{
}