-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMySampleForm.cs
43 lines (35 loc) · 1.16 KB
/
MySampleForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
namespace TestWorks
{
public partial class MySampleForm : System.Windows.Forms.Form
{
Document Doc;
public MySampleForm (Document doc)
{
InitializeComponent();
Doc = doc;
}
private void Wall_Count_Click(object sender, EventArgs e)
{
ICollection<Element> walls = new FilteredElementCollector(Doc, Doc.ActiveView.Id)
.OfCategory(BuiltInCategory.OST_Walls).ToElements();
SampleCollector sc = new SampleCollector();
List<Wall> ListWalls_Class = sc.GetWalls_Class(Doc);
TaskDialog.Show("Wall Count", walls.Count.ToString() + "walls from Active View method" + "\n"
+ ListWalls_Class.Count.ToString() + "walls from Linq method of Sample collector");
}
private void MySampleForm_Load(object sender, EventArgs e)
{
}
}
}