-
Notifications
You must be signed in to change notification settings - Fork 0
/
prmhelper.cs
52 lines (43 loc) · 1.29 KB
/
prmhelper.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
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System.Linq;
using Autodesk.Revit.UI.Selection;
using System.IO;
namespace TaskClient
{
public static class prmhelper
{
public static string GetParameterValueString(Element e, BuiltInParameter bip)
{
Parameter p = e.get_Parameter(bip);
string s = string.Empty;
if (null != p)
{
switch (p.StorageType)
{
case StorageType.Integer:
s = p.AsInteger().ToString();
break;
case StorageType.ElementId:
s = p.AsElementId().IntegerValue.ToString();
break;
case StorageType.Double:
s = p.AsDouble().ToString();
break;
case StorageType.String:
s = p.AsDouble().ToString();
break;
default:
s = "";
break;
}
}
return s;
}
}
}