123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /*-------------------------------------------------------------------------
- * 功能描述: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.Column) };
- }
- 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,true));
- StandardUtil.ArrangeLoop(outLine);
- jObject.OutLine.Add(outLine);
- }
- var parameter = familyInstance.GetParameter(BuiltInParameter.WALL_ATTR_ROOM_BOUNDING);
- if (parameter != null)
- {
- jObject.RoomBoundary=parameter.AsInteger() == 1;
- }
- context.AddBimObject(jObject);
- return new List<BimId>() { jObject.Id };
- }
- }
- }
|