|
@@ -16,22 +16,14 @@ using SAGA.MBI.Model;
|
|
|
using SAGA.RevitUtils;
|
|
|
using SAGA.RevitUtils.Extends;
|
|
|
|
|
|
-namespace SAGA.MBI.WinView.Space
|
|
|
+namespace SAGA.MBI.WinView
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 元空间管理相关模操作
|
|
|
/// </summary>
|
|
|
public class SpaceManager
|
|
|
{
|
|
|
- #region 物理世界空间管理
|
|
|
- public static List<MSpace> GetPhysicalSpaces(List<string> bimIds)
|
|
|
- {
|
|
|
- List<MSpace> spaces = new List<MSpace>();
|
|
|
-
|
|
|
-
|
|
|
- return spaces;
|
|
|
- }
|
|
|
- #endregion
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
|
/// 更新项目中的空间分割
|
|
@@ -39,7 +31,7 @@ namespace SAGA.MBI.WinView.Space
|
|
|
/// <param name="doc"></param>
|
|
|
/// <param name="separations"></param>
|
|
|
/// <param name="deletedIds"></param>
|
|
|
- public static void UpdateSpaceSequarate(Document doc,List<SpaceSeparation> separations,List<int> deletedIds)
|
|
|
+ public static void UpdateSpaceSequaration(Document doc,List<SpaceSeparation> separations,List<int> deletedIds)
|
|
|
{
|
|
|
using (Transaction trans = new Transaction(doc, "更新空间分隔符"))
|
|
|
{
|
|
@@ -111,42 +103,18 @@ namespace SAGA.MBI.WinView.Space
|
|
|
/// <param name="doc"></param>
|
|
|
public static void CreateSpace(Document doc)
|
|
|
{
|
|
|
- using (Transaction trans = new Transaction(doc, "创建空间"))
|
|
|
+ doc.LoadFamilySymbolExt(MBIConst.SpaceTagFamilyFilePath);
|
|
|
+ var view = doc.GetUseView();
|
|
|
+ if (view != null)
|
|
|
{
|
|
|
- {
|
|
|
- trans.Start();
|
|
|
- try
|
|
|
- {
|
|
|
- doc.LoadFamilySymbolExt(MBIConst.SpaceTagFamilyFilePath);
|
|
|
- FailureHandlingOptions fho = trans.GetFailureHandlingOptions();
|
|
|
- fho.SetFailuresPreprocessor(new FailuresPreprocessor());
|
|
|
- trans.SetFailureHandlingOptions(fho);
|
|
|
- var view = doc.GetUseView();
|
|
|
- if (view != null)
|
|
|
- {
|
|
|
- Parameter para = view.GetParameter(BuiltInParameter.VIEW_PHASE);
|
|
|
- ElementId phaseId = para.AsElementId();
|
|
|
-
|
|
|
- var phase = doc.GetElement(phaseId) as Phase;
|
|
|
- var level = view.GenLevel;
|
|
|
- //如果视图范围不对,也不能很好的创建空间
|
|
|
+ Parameter para = view.GetParameter(BuiltInParameter.VIEW_PHASE);
|
|
|
+ ElementId phaseId = para.AsElementId();
|
|
|
|
|
|
- ICollection<ElementId> elements = doc.Create.NewSpaces2(level, phase, view);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageShow.Infomation("没有找到名称以-saga结尾的平面");
|
|
|
- }
|
|
|
- //doc.Regenerate();
|
|
|
- trans.Commit();
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- trans.RollBack();
|
|
|
- MessageShow.Show(e);
|
|
|
- }
|
|
|
- }
|
|
|
+ var phase = doc.GetElement(phaseId) as Phase;
|
|
|
+ var level = view.GenLevel;
|
|
|
+ doc.Create.NewSpaces2(level, phase, view);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// <summary>
|