|
@@ -13,10 +13,12 @@ using System.Threading.Tasks;
|
|
|
using Autodesk.Revit.DB;
|
|
|
using JBIM;
|
|
|
using JBIM.Component;
|
|
|
+using JBIM.Definition;
|
|
|
using RevitExport.Export;
|
|
|
using RevitToJBim.Common;
|
|
|
using JFamilyType=RevitToJBim.Common.FamilyType;
|
|
|
using RevitToJBim.ParseData;
|
|
|
+using SAGA.RevitUtils.Extends;
|
|
|
using SAGA.RevitUtils.MEP;
|
|
|
|
|
|
namespace RevitToJBim.ComponentParse
|
|
@@ -39,11 +41,23 @@ namespace RevitToJBim.ComponentParse
|
|
|
{
|
|
|
return null;
|
|
|
}
|
|
|
+ //ElementType
|
|
|
OtherJoinObject jObject = new OtherJoinObject();
|
|
|
+ //Name,SourceId
|
|
|
ParseCore.AttachObject(jObject, wrapper);
|
|
|
+ //Location
|
|
|
+ jObject.Location = GeometryLocation.CreatePointLocation(BimConvert.ConvertToXYZ(familyInstance.GetLocationPoint()));
|
|
|
+ //OutLine
|
|
|
+ var polygonPath = RevitUtil.GetBottomPolygon(familyInstance);
|
|
|
+ if (polygonPath != null && polygonPath.Any())
|
|
|
+ {
|
|
|
+ Polygon outLine = new Polygon(BimConvert.ConvertToXYZs(polygonPath));
|
|
|
+ jObject.OutLine.Add(outLine);
|
|
|
+ }
|
|
|
+ //Id
|
|
|
context.AddBimObject(jObject);
|
|
|
#region Connector连接关系
|
|
|
- var connectors = GetConnectors(familyInstance);
|
|
|
+ var connectors = familyInstance.GetAllConnectors();
|
|
|
if (connectors.Any())
|
|
|
{
|
|
|
ElementOneToManyRel relMany = ParseCore.GetConnectorRels(familyInstance,connectors);
|
|
@@ -61,17 +75,12 @@ namespace RevitToJBim.ComponentParse
|
|
|
}
|
|
|
|
|
|
var wrappers = new List<ElementWrapper>() { };
|
|
|
- var connectors = GetConnectors(fi);
|
|
|
+ var connectors = fi.GetAllConnectors();
|
|
|
foreach (var connector in connectors)
|
|
|
{
|
|
|
wrappers.Add(ParseCore.GetConnectorWrapper(connector));
|
|
|
}
|
|
|
return wrappers;
|
|
|
}
|
|
|
-
|
|
|
- public List<Autodesk.Revit.DB.Connector> GetConnectors(Element familyInstance)
|
|
|
- {
|
|
|
- return familyInstance.GetAllConnectors();
|
|
|
- }
|
|
|
}
|
|
|
}
|