/* ============================================================================== * 功能描述:ParseUnit * 创 建 者:Garrett * 创建日期:2019/6/26 15:15:33 * ==============================================================================*/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using JBIM; using RevitExport.Export; using Autodesk.Revit.DB; using RevitToJBim.Common; using JUnit=JBIM.Component.Unit; namespace RevitToJBim.ComponentParse { /// /// ParseUnit /// [UsableParseAttribute] class ParseUnit : ParseBase { public override List FastIndex() { return new List() { CategoryGenerator.BuildingCategory(Common.FamilyType.Other) }; } public override bool Match(ElementWrapper wrapper) { return wrapper.RefObject is FormatOptions; } protected override List ParseInner(ElementWrapper wrapper, JBimParseContext context) { var options= wrapper.RefObject as FormatOptions; if (options == null) { return null; } JUnit jObject = new JUnit(); jObject.Name = "Length"; jObject.Tag = "长度单位"; jObject.Value = options.DisplayUnits.ToString(); context.AddBimObject(jObject); return new List(){jObject.Id}; } } }