using HStation.RevitDev.Model.AttributeClass; using HStation.RevitDev.Model.ModelEnum; using HStation.RevitDev.RevitDataExport.Parser; namespace HStation.RevitDev.RevitDataExport.Utility { public static class ParserUtils { public static RevitType GetRevitType(this BaseParser parser) { if (parser == null) { return RevitType.RFT_Others; } var type = parser.GetType(); var attr = type.GetCustomAttributes(false)?[0]; if (attr == null) { return RevitType.RFT_Others; } if (attr is RevitTypeAttribute rtAttr) { return rtAttr.m_revitType; } return RevitType.RFT_Others; } } }