-
Notifications
You must be signed in to change notification settings - Fork 0
/
Params.cs
68 lines (51 loc) · 1.62 KB
/
Params.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
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 Form = System.Windows.Forms.Form;
namespace WorkApp
{
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public partial class Params : Form, IExternalCommand
{
List<paramData> paramSet = new List<paramData>();
private BindingSource bindingSource1 = new BindingSource();
public Params()
{
InitializeComponent();
dataGridView1.DataSource = bindingSource1;
}
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements)
{
var doc=commandData.Application.ActiveUIDocument.Document;
var map = doc.ParameterBindings.ForwardIterator();
map.Reset();
while (map.MoveNext())
{
var pp=new paramData();
pp.Definition = map.Key;
pp.Name = map.Key.Name;
pp.Binding=map.Current as ElementBinding;
paramSet.Add(pp);
}
this.Show();
return Result.Succeeded;
}
void GetData(string selectCommand)
{
}
}
public class paramData
{
public Definition Definition;
public string Name;
public ElementBinding Binding { get; internal set; }
}
}