12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /* ==============================================================================
- * 功能描述:ParseLevel
- * 创 建 者:Garrett
- * 创建日期:2019/6/26 15:16:34
- * ==============================================================================*/
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Autodesk.Revit.DB;
- using JBIM;
- using RevitExport.Export;
- using RevitToJBim.Common;
- using SAGA.RevitUtils.Extends;
- using JLevel=JBIM.Component.Level;
- namespace RevitToJBim.ComponentParse
- {
- /// <summary>
- /// ParseLevel
- /// </summary>
- [UsableParseAttribute]
- class ParseLevel : ParseBase
- {
- public override List<string> FastIndex()
- {
- return new List<string>() { typeof(Level).FullName };
- }
- public override bool Match(ElementWrapper wrapper)
- {
- return wrapper.RefElement is Level;
- }
- protected override List<BimId> ParseInner(ElementWrapper wrapper, JBimParseContext context)
- {
- var level = wrapper.RefElement as Level;
- if (level == null)
- {
- return null;
- }
- JLevel jObject=new JLevel();
- //ElementType
- ParseCore.AttachObject(jObject,wrapper);
- //Name,SourceId
- jObject.Name = level.Name;
- //Value
- jObject.Value = level.Elevation.FtToUse();
- //Id
- context.AddBimObject(jObject);
- return new List<BimId>(){jObject.Id};
- }
- }
- }
|