Преглед на файлове

mxg:修改虚拟墙不能导出问题,弧形墙导出location为Line问题

mengxiangge преди 5 години
родител
ревизия
f8a7745f6c

+ 7 - 0
Executer/DataExport/JBIM/Definition/GeometryLocation.cs

@@ -42,5 +42,12 @@ namespace JBIM.Definition
             result.Points.AddRange(xyzes);
             return result;
         }
+
+        public static GeometryLocation CreateArcLocation(List<XYZ> xyzes)
+        {
+            var result = new GeometryLocation(LocationType.Arc);
+            result.Points.AddRange(xyzes);
+            return result;
+        }
     }
 }

+ 4 - 1
Executer/DataExport/RevitToJBim/ComponentParse/ParseCore.cs

@@ -136,7 +136,10 @@ namespace RevitToJBim.ComponentParse
             else if (location is LocationCurve curve)
             {
                 var useCurve = curve.Curve.GetPoints();
-                return GeometryLocation.CreateLineLocation(useCurve.Select(xyz=>BimConvert.ConvertToXYZ(xyz)).ToList());
+                if (curve.Curve is Line)
+                    return GeometryLocation.CreateLineLocation(useCurve.Select(xyz => BimConvert.ConvertToXYZ(xyz)).ToList());
+                else if (curve.Curve is Arc)
+                    return GeometryLocation.CreateArcLocation(useCurve.Select(xyz => BimConvert.ConvertToXYZ(xyz)).ToList());
             }
 
             return null;

+ 3 - 3
Executer/DataExport/RevitToJBim/ComponentParse/ParseVirtualWall.cs

@@ -25,17 +25,17 @@ namespace RevitToJBim.ComponentParse
     {
         public override List<string> FastIndex()
         {
-            return new List<string>() { typeof(SpatialElement).FullName };
+            return new List<string>() { typeof(CurveElement).FullName };
         }
         public override bool Match(ElementWrapper wrapper)
         {
-            return wrapper.RefElement is SpatialElement;
+            return wrapper.RefElement is CurveElement;
         }
 
 
         protected override List<BimId> ParseInner(ElementWrapper wrapper, JBimParseContext context)
         {
-            if (!(wrapper.RefElement is SpatialElement se))
+            if (!(wrapper.RefElement is CurveElement se))
             {
                 return null;
             }

+ 1 - 1
Executer/DataExport/RevitToJBim/MbiExport.cs

@@ -42,7 +42,7 @@ namespace RevitToJBim
                 var resultResponse = UploadService.UploadExportFile(result);
                 string fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
                 string path = Path.Combine(@"D:\", $"{fileName}.json");
-                File.WriteAllText(path, resultResponse.ToString());
+                File.WriteAllText(path, result.ToString());
                 System.Diagnostics.Process.Start("notepad.exe", path);
             }
             catch (Exception ex)

+ 2 - 2
Starter/StartVisionSelector/Program.cs

@@ -24,8 +24,8 @@ namespace StartVisionSelector
             if (string.IsNullOrWhiteSpace(command))
             {
                 command = "DataExport";
-                //path = @"E:\导出测试\testR17.rvt";
-                path = @"E:\导出测试\testR18.rvt";
+                path = @"E:\导出测试\testR17.rvt";
+                //path = @"E:\导出测试\testR18.rvt";
                 //path = @"E:\导出测试\testR16.rvt";
             }