浏览代码

xls:增加房间面积为0的相关提示

xulisong 5 年之前
父节点
当前提交
0e3ad72c9b
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      MBI/ToolCommand/RoomToSpaceUtils.cs

+ 10 - 6
MBI/ToolCommand/RoomToSpaceUtils.cs

@@ -121,10 +121,6 @@ namespace ToolCommand
             {
                 var relationItem = new RoomRelationItem() { RoomId = room.Id.ToString() };
                 relations.Add(relationItem);
-                if (2165067 == room.Id.IntegerValue)
-                {
-
-                }
                 using (SubTransaction subTran = new SubTransaction(doc))
                 {
                     Space useSpcae = null;
@@ -135,7 +131,7 @@ namespace ToolCommand
                         if (location == null)
                         {
                             //|| room.Area.IsEqual(0)
-                            relationItem.Messages.Add("房间信息无效");
+                            relationItem.Messages.Add("房间信息无效,定位点为空");
                             continue;
                         }
                         useSpcae = doc.GetSpaceAtPoint(location.Add(offset));
@@ -150,7 +146,15 @@ namespace ToolCommand
                         //成功
                         handledSpaces.Add(useSpcae.Id.IntegerValue);
                         relationItem.SpaceId = useSpcae.Id.ToString();
-                        relationItem.IsSuccess = true;
+                        if (room.Area.IsEqual(0))
+                        {
+                            relationItem.Messages.Add("房间面积为0");
+                        }
+                        else
+                        {
+                            relationItem.IsSuccess = true;
+                        }
+                     
                     }
                     catch (Exception ex)
                     {