zhangyk-c
2024-07-30 e5b04afb7062a908c700f66a1a33aaa5eb98b7bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using HStation.RevitDev.Model.AttributeClass;
using HStation.RevitDev.Model.ModelEnum;
using System;
using System.Reflection;
 
namespace HStation.RevitDev.Model.Common
{
    public class ElementTypeMapping
    {
        public static ExportType GetExportType(RevitType revitType)
        {
            Type type = revitType.GetType();
            FieldInfo fieldInfo = type.GetField(revitType.ToString());
            var attr = fieldInfo.GetCustomAttribute<ExportModelAttribute>();
            if (attr != null) { return attr.ExportType; }
 
            return ExportType.EFT_Unknown;
        }
    }
}