|
@@ -15,6 +15,7 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using SAGA.DotNetUtils.Logger;
|
|
|
|
|
|
namespace SAGA.MBI.RevitExport
|
|
|
{
|
|
@@ -32,7 +33,7 @@ namespace SAGA.MBI.RevitExport
|
|
|
CalcLevel(spaceDecorator, decorators);
|
|
|
}
|
|
|
|
|
|
- decorators=decorators.OrderByDescending(s => s.Level).ToList();
|
|
|
+ decorators = decorators.OrderByDescending(s => s.Level).ToList();
|
|
|
return decorators.Select(sd => sd.Space).ToList();
|
|
|
}
|
|
|
|
|
@@ -49,7 +50,7 @@ namespace SAGA.MBI.RevitExport
|
|
|
}
|
|
|
var useLevel = 0;
|
|
|
try
|
|
|
- {
|
|
|
+ {
|
|
|
var containsSpaces = new List<SpaceDecorator>();
|
|
|
foreach (SpaceDecorator item in decorators)
|
|
|
{
|
|
@@ -62,10 +63,10 @@ namespace SAGA.MBI.RevitExport
|
|
|
{
|
|
|
containsSpaces.Add(item);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
foreach (var item in containsSpaces)
|
|
|
{
|
|
|
- var tempLevel = CalcLevel(item, decorators)+1;
|
|
|
+ var tempLevel = CalcLevel(item, decorators) + 1;
|
|
|
useLevel = Math.Max(useLevel, tempLevel);
|
|
|
}
|
|
|
return useLevel;
|
|
@@ -82,7 +83,7 @@ namespace SAGA.MBI.RevitExport
|
|
|
/// <param name="aFSpace"></param>
|
|
|
/// <param name="bSpace"></param>
|
|
|
/// <returns></returns>
|
|
|
- private static bool IsContains(SpaceDecorator aFSpace, SpaceDecorator bSpace)
|
|
|
+ private static bool IsContains(SpaceDecorator aFSpace, SpaceDecorator bSpace)
|
|
|
{
|
|
|
bool flag = false;
|
|
|
if (aFSpace.Annular == null || bSpace.Annular == null)
|
|
@@ -90,8 +91,8 @@ namespace SAGA.MBI.RevitExport
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
- var basePolygon = aFSpace.Annular.OutPolygon;
|
|
|
- var refPolygon = bSpace.Annular.OutPolygon;
|
|
|
+ var basePolygon = aFSpace.Annular?.OutPolygon;
|
|
|
+ var refPolygon = bSpace.Annular?.OutPolygon;
|
|
|
if (basePolygon == null || refPolygon == null)
|
|
|
{
|
|
|
return flag;
|
|
@@ -124,7 +125,7 @@ namespace SAGA.MBI.RevitExport
|
|
|
public SpaceDecorator(Space space)
|
|
|
{
|
|
|
Space = space;
|
|
|
- var mySegments = space.GetBoundarySegments(new SpatialElementBoundaryOptions());
|
|
|
+ var mySegments = space.GetBoundarySegments(new SpatialElementBoundaryOptions());
|
|
|
Annular = InitAnnular(mySegments);
|
|
|
}
|
|
|
public Space Space { get; private set; }
|
|
@@ -163,7 +164,15 @@ namespace SAGA.MBI.RevitExport
|
|
|
{
|
|
|
#region 外轮廓处理,默认逆时针
|
|
|
|
|
|
- annumlar = new Annular(new Polygon(usePoints));
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //特殊情况下空间边界由
|
|
|
+ annumlar = new Annular(new Polygon(usePoints));
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ Log4Net.Debug(e.Message + "\r\n" + e.StackTrace);
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
}
|