1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /*-------------------------------------------------------------------------
- * 功能描述:ParseColumn
- * 作者:xulisong
- * 创建时间: 2019/6/24 9:49:28
- * 版本号:v1.0
- * -------------------------------------------------------------------------*/
- using Autodesk.Revit.DB;
- using JBIM;
- using RevitExport.Export;
- using RevitToJBim.Common;
- using System;
- using System.Collections.Generic;
- using JFamilyType = RevitToJBim.Common.FamilyType;
- using JColumn =JBIM.Component.Column;
- using SAGA.RevitUtils.Extends;
- using SAGA.RevitUtils.Extends.Graphic;
- using System.Linq;
- using JBIM.Definition;
- namespace RevitToJBim.ComponentParse
- {
- [UsableParse]
- public class ParseColumn : ParseBase
- {
- public override List<string> FastIndex()
- {
- return new List<string>() { CategoryGenerator.BuildingCategory(JFamilyType.Other) };
- }
- public override bool Match(ElementWrapper wrapper)
- {
- return wrapper.Category == CategoryGenerator.BuildingCategory(JFamilyType.Other);
- }
- protected override List<BimId> ParseInner(ElementWrapper wrapper, JBimParseContext context)
- {
- if (!(wrapper.RefElement is FamilyInstance familyInstance))
- {
- return null;
- }
- JColumn jObject = new JColumn();
- ParseCore.AttachObject(jObject, wrapper);
- jObject.Location = ParseCore.GetLocation(familyInstance.Location);
- var polygonPath = RevitUtil.GetTopPolygon(familyInstance);
- if (polygonPath != null && polygonPath.Any())
- {
- Polygon outLine = new Polygon(BimConvert.ConvertToXYZs(polygonPath));
- jObject.OutLine.Add(outLine);
- }
- context.AddBimObject(jObject);
- return new List<BimId>() { jObject.Id };
- }
- }
- }
|