From 1e66b4cc1183f30ff6add72750f3e9e155ff7f9a Mon Sep 17 00:00:00 2001
From: zhangyuekai <zhangyuekai@126.com>
Date: 星期四, 08 八月 2024 11:55:22 +0800
Subject: [PATCH] 导出模块、族库模块等其他模块开发完成

---
 HStation.RevitDev/RevitDataExport/Forms/Form_SystemSelect.cs |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/HStation.RevitDev/RevitDataExport/Forms/Form_SystemSelect.cs b/HStation.RevitDev/RevitDataExport/Forms/Form_SystemSelect.cs
index f78c7cc..7a0ae05 100644
--- a/HStation.RevitDev/RevitDataExport/Forms/Form_SystemSelect.cs
+++ b/HStation.RevitDev/RevitDataExport/Forms/Form_SystemSelect.cs
@@ -8,7 +8,7 @@
 using HStation.RevitDev.RevitDataExport.Common;
 using HStation.RevitDev.RevitDataExport.Service;
 using HStation.RevitDev.RevitDataExport.Utility;
-using HStation.RevitDev.RevitDataExport.Utils;
+using HStation.RevitDev.RevitDataExport.Common;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -106,6 +106,7 @@
 
             if (cell.Value == null) { return; }
             var view = Set3DView();
+            if (view == null) { return; }
 
             var cellText = cell.Value.ToString();
             if (dgv.Columns[columnIndex].HeaderText == "ID" ||
@@ -132,7 +133,9 @@
             var cell = dgv[columnIndex, rowIndex];
 
             if (cell.Value == null) { return; }
-            var view = Set3DView();
+            var view = Set3DView();
+            if (view == null) { return; }
+
 
             var cellText = cell.Value.ToString();
             if (dgv.Columns[columnIndex].HeaderText == "ID" ||
@@ -166,6 +169,7 @@
         private View3D Set3DView()
         {
             var view3d = ViewHelper.Get3dView(_doc);
+            if (view3d == null) { return null; }
             _uiDocument.ActiveView = view3d;
             return view3d;
         }
@@ -324,7 +328,9 @@
             List<int> indexes = GetCheckedIndexes(this._itemCheck);
             Dictionary<string, List<Element>> dict = GetGroupElements(indexes);
             var elemIds = dict.Values.SelectMany(x => x).Select(y => y.Id).ToList();
-            var view = Set3DView();
+            var view = Set3DView();
+            if (view == null) { return; }
+
             if (elemIds.Count != 0)
             {
                 view.OnlyShow(elemIds);

--
Gitblit v1.9.3