修复bug和新增部分功能
This commit is contained in:
@@ -21,6 +21,6 @@ public class QuickViewSectionCmd : ExternalCommand
|
||||
{
|
||||
public override void Execute()
|
||||
{
|
||||
WinDialogHelper.ShowModeless<QuickViewSectionView>(new QuickViewSectionViewModel(UiDocument));
|
||||
WinDialogHelper.ShowModeless<QuickViewSectionView>(new QuickViewSectionViewModel());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
Title="快速剖面"
|
||||
Width="250"
|
||||
Height="180"
|
||||
MinHeight="180"
|
||||
d:DataContext="{d:DesignInstance Type=local:QuickViewSectionViewModel}"
|
||||
SizeToContent="Height"
|
||||
mc:Ignorable="d">
|
||||
@@ -17,7 +16,7 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/Sai.RvKits;component/WPFUI.xaml" />
|
||||
</Window.Resources>
|
||||
<ex:StackPanelEx Margin="5" Spacing="5">
|
||||
<GroupBox Grid.Row="0" Header="剖面线">
|
||||
<GroupBox Header="剖面线">
|
||||
<UniformGrid Rows="1">
|
||||
<RadioButton
|
||||
HorizontalAlignment="Center"
|
||||
@@ -30,10 +29,18 @@
|
||||
IsChecked="{Binding IsParallel, Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding CreateViewSectionCommand}"
|
||||
Content="创建" />
|
||||
<UniformGrid Rows="1">
|
||||
<Button
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding CreateViewSectionCommand}"
|
||||
Content="创建" />
|
||||
<Button
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding DeleteViewSectionCommand}"
|
||||
Content="删除"
|
||||
ToolTip="删除全部在当前窗口打开时(本次)创建的快速剖面" />
|
||||
</UniformGrid>
|
||||
</ex:StackPanelEx>
|
||||
</ex:FluentWindowEx>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
@@ -10,140 +12,170 @@ using Nice3point.Revit.Toolkit.External.Handlers;
|
||||
|
||||
namespace Sai.RvKits.RvView
|
||||
{
|
||||
public partial class QuickViewSectionViewModel(UIDocument uidoc) : ObservableObject
|
||||
public partial class QuickViewSectionViewModel : ObservableObject
|
||||
{
|
||||
private readonly ActionEventHandler handler = new();
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isParallel = true;
|
||||
private readonly List<ViewSection> viewSections = [];
|
||||
|
||||
[RelayCommand]
|
||||
private void DeleteViewSection()
|
||||
{
|
||||
handler.Raise(
|
||||
uiapp =>
|
||||
{
|
||||
var uidoc = uiapp.ActiveUIDocument;
|
||||
var doc = uidoc.Document;
|
||||
doc.Invoke(
|
||||
ts =>
|
||||
{
|
||||
for (var i = viewSections.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var view = viewSections[i];
|
||||
if (view.IsValidObject)
|
||||
{
|
||||
var uiView = uidoc.GetOpenUIViews().FirstOrDefault(ui => ui.ViewId == view.Id);
|
||||
|
||||
uiView?.Close();
|
||||
viewSections.Remove(view);
|
||||
doc.Delete(view.Id);
|
||||
|
||||
}
|
||||
}
|
||||
}, "删除快速剖面");
|
||||
});
|
||||
}
|
||||
[RelayCommand]
|
||||
private void CreateViewSection()
|
||||
{
|
||||
var element = uidoc.SelectObject(new FuncFilter(elem => elem.GetLocCurve() is Line));
|
||||
if (element != null)
|
||||
{
|
||||
var lc = element.Location as LocationCurve;
|
||||
var line = lc.Curve as Line;
|
||||
var doc = uidoc.Document;
|
||||
var viewfamilyType = doc.OfClass<ViewFamilyType>()
|
||||
.Cast<ViewFamilyType>()
|
||||
.Where(t => t.ViewFamily == ViewFamily.Section)
|
||||
.FirstOrDefault();
|
||||
var bb = element.get_BoundingBox(null);
|
||||
var minZ = bb.Min.Z;
|
||||
var maxZ = bb.Max.Z;
|
||||
handler.Raise(
|
||||
uiapp =>
|
||||
{
|
||||
var uidoc = uiapp.ActiveUIDocument;
|
||||
var element = uidoc.SelectObject(new FuncFilter(elem => elem.GetLocCurve() is Line));
|
||||
var lc = element.Location as LocationCurve;
|
||||
var line = lc.Curve as Line;
|
||||
var doc = uidoc.Document;
|
||||
var viewfamilyType = doc.OfClass<ViewFamilyType>()
|
||||
.Cast<ViewFamilyType>()
|
||||
.Where(t => t.ViewFamily == ViewFamily.Section)
|
||||
.FirstOrDefault();
|
||||
var bb = element.get_BoundingBox(null);
|
||||
var minZ = bb.Min.Z;
|
||||
var maxZ = bb.Max.Z;
|
||||
|
||||
var baseLength = (bb.Max - bb.Min).GetLength();
|
||||
var baseLength = (bb.Max - bb.Min).GetLength();
|
||||
|
||||
ViewSection viewSection = null;
|
||||
BoundingBoxXYZ sectionBox;
|
||||
var offset = 0.2 * baseLength;
|
||||
var t = Transform.Identity;
|
||||
Debug.WriteLine($"Length:{baseLength}");
|
||||
Debug.WriteLine($"Offset:{offset}");
|
||||
Debug.WriteLine("拾取对象:");
|
||||
ViewSection viewSection = null;
|
||||
BoundingBoxXYZ sectionBox;
|
||||
var offset = 0.2 * baseLength;
|
||||
var t = Transform.Identity;
|
||||
Debug.WriteLine($"Length:{baseLength}");
|
||||
Debug.WriteLine($"Offset:{offset}");
|
||||
Debug.WriteLine("拾取对象:");
|
||||
|
||||
Debug.WriteLine($"Min:{bb.Min}");
|
||||
Debug.WriteLine($"Max:{bb.Max}");
|
||||
Debug.WriteLine($"Min:{bb.Min}");
|
||||
Debug.WriteLine($"Max:{bb.Max}");
|
||||
|
||||
t.Origin = line.Evaluate(0.5, true).Flatten();
|
||||
Debug.WriteLine("定义剖面:");
|
||||
Debug.WriteLine($"Transform.Origin:{t.Origin}");
|
||||
t.BasisY = XYZ.BasisZ;//UpDirection
|
||||
var viewName = $"{element.Category.Name}({element.Id})";
|
||||
if (IsParallel)
|
||||
{
|
||||
var min = new XYZ(-baseLength / 2, minZ - offset, -offset);
|
||||
var max = new XYZ(baseLength / 2, maxZ + offset, offset);
|
||||
Debug.WriteLine($"Min:{min}");
|
||||
Debug.WriteLine($"Max:{max}");
|
||||
|
||||
viewName = $"平行剖面-{viewName}";
|
||||
t.BasisX = line.Direction;//与生成的最终剖面视图的RightDirection反向(定义Transform)
|
||||
t.BasisZ = line.Direction.CrossProduct(XYZ.BasisZ);//与生成的最终剖面视图的ViewDirection反向(定义Transform)
|
||||
Debug.WriteLine($"Transform.BasisX:{t.BasisX}");
|
||||
Debug.WriteLine($"Transform.BasisZ:{t.BasisZ}");
|
||||
|
||||
sectionBox = new BoundingBoxXYZ
|
||||
{
|
||||
Transform = t,
|
||||
Min = min,
|
||||
Max = max
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
//var transform = line.ComputeDerivatives(0.5, true);//求导切向为BasisX
|
||||
viewName = $"正交剖面-{viewName}";
|
||||
t.BasisX = XYZ.BasisZ.CrossProduct(line.Direction);
|
||||
t.BasisZ = line.Direction;
|
||||
var min = new XYZ(-3000 / 304.8 / 2, minZ - offset, -offset);
|
||||
var max = new XYZ(3000 / 304.8 / 2, maxZ + offset, offset);
|
||||
|
||||
Debug.WriteLine($"Transform.BasisX:{t.BasisX}");
|
||||
Debug.WriteLine($"Transform.BasisZ:{t.BasisZ}");
|
||||
|
||||
sectionBox = new BoundingBoxXYZ
|
||||
{
|
||||
Transform = t,
|
||||
Min = min,
|
||||
Max = max
|
||||
};
|
||||
}
|
||||
handler.Raise(
|
||||
_ =>
|
||||
t.Origin = line.Evaluate(0.5, true).Flatten();
|
||||
Debug.WriteLine("定义剖面:");
|
||||
Debug.WriteLine($"Transform.Origin:{t.Origin}");
|
||||
t.BasisY = XYZ.BasisZ;//UpDirection
|
||||
var viewName = $"{element.Category.Name}({element.Id})";
|
||||
if (IsParallel)
|
||||
{
|
||||
doc.Invoke(
|
||||
ts =>
|
||||
var min = new XYZ(-baseLength / 2, minZ - offset, -offset);
|
||||
var max = new XYZ(baseLength / 2, maxZ + offset, offset);
|
||||
Debug.WriteLine($"Min:{min}");
|
||||
Debug.WriteLine($"Max:{max}");
|
||||
|
||||
viewName = $"平行剖面-{viewName}";
|
||||
t.BasisX = line.Direction;//与生成的最终剖面视图的RightDirection反向(定义Transform)
|
||||
t.BasisZ = line.Direction.CrossProduct(XYZ.BasisZ);//与生成的最终剖面视图的ViewDirection反向(定义Transform)
|
||||
Debug.WriteLine($"Transform.BasisX:{t.BasisX}");
|
||||
Debug.WriteLine($"Transform.BasisZ:{t.BasisZ}");
|
||||
|
||||
sectionBox = new BoundingBoxXYZ
|
||||
{
|
||||
Transform = t,
|
||||
Min = min,
|
||||
Max = max
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
//var transform = line.ComputeDerivatives(0.5, true);//求导切向为BasisX
|
||||
viewName = $"正交剖面-{viewName}";
|
||||
t.BasisX = XYZ.BasisZ.CrossProduct(line.Direction);
|
||||
t.BasisZ = line.Direction;
|
||||
var min = new XYZ(-3000 / 304.8 / 2, minZ - offset, -offset);
|
||||
var max = new XYZ(3000 / 304.8 / 2, maxZ + offset, offset);
|
||||
|
||||
Debug.WriteLine($"Transform.BasisX:{t.BasisX}");
|
||||
Debug.WriteLine($"Transform.BasisZ:{t.BasisZ}");
|
||||
|
||||
sectionBox = new BoundingBoxXYZ
|
||||
{
|
||||
Transform = t,
|
||||
Min = min,
|
||||
Max = max
|
||||
};
|
||||
}
|
||||
doc.Invoke(
|
||||
ts =>
|
||||
{
|
||||
viewSection = ViewSection.CreateSection(uidoc.Document, viewfamilyType.Id, sectionBox);
|
||||
viewSection.DisplayStyle = DisplayStyle.ShadingWithEdges;
|
||||
viewSection.DetailLevel = ViewDetailLevel.Fine;
|
||||
var isExistName = false;
|
||||
try
|
||||
{
|
||||
viewSection = ViewSection.CreateSection(uidoc.Document, viewfamilyType.Id, sectionBox);
|
||||
viewSection.DisplayStyle = DisplayStyle.ShadingWithEdges;
|
||||
viewSection.DetailLevel = ViewDetailLevel.Fine;
|
||||
var isExistName = false;
|
||||
try
|
||||
viewSection.Name = viewName;
|
||||
}
|
||||
catch (Autodesk.Revit.Exceptions.ArgumentException)
|
||||
{
|
||||
isExistName = true;
|
||||
}
|
||||
if (isExistName)
|
||||
{
|
||||
for (var i = 0; i < 100; i++)
|
||||
{
|
||||
viewSection.Name = viewName;
|
||||
}
|
||||
catch (Autodesk.Revit.Exceptions.ArgumentException)
|
||||
{
|
||||
isExistName = true;
|
||||
}
|
||||
if (isExistName)
|
||||
{
|
||||
for (var i = 0; i < 100; i++)
|
||||
try
|
||||
{
|
||||
viewSection.Name = $"{viewName} {i + 1}";
|
||||
break;
|
||||
}
|
||||
catch (Autodesk.Revit.Exceptions.ArgumentException)
|
||||
{
|
||||
try
|
||||
{
|
||||
viewSection.Name = $"{viewName} {i + 1}";
|
||||
break;
|
||||
}
|
||||
catch (Autodesk.Revit.Exceptions.ArgumentException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.Commit();
|
||||
Debug.WriteLine("生成后:");
|
||||
}
|
||||
ts.Commit();
|
||||
if (viewSection != null)
|
||||
{
|
||||
viewSections.Add(viewSection);
|
||||
}
|
||||
Debug.WriteLine("生成后:");
|
||||
|
||||
Debug.WriteLine($"CropBox.Origin:{viewSection.CropBox.Transform.Origin}");
|
||||
Debug.WriteLine($"CropBox.BasisX:{viewSection.CropBox.Transform.BasisX}");
|
||||
Debug.WriteLine($"CropBox.BasisZ:{viewSection.CropBox.Transform.BasisZ}");
|
||||
Debug.WriteLine($"CropBox.Origin:{viewSection.CropBox.Transform.Origin}");
|
||||
Debug.WriteLine($"CropBox.BasisX:{viewSection.CropBox.Transform.BasisX}");
|
||||
Debug.WriteLine($"CropBox.BasisZ:{viewSection.CropBox.Transform.BasisZ}");
|
||||
|
||||
Debug.WriteLine($"CropBox.Min:{viewSection.CropBox.Min}");
|
||||
Debug.WriteLine($"CropBox.Max:{viewSection.CropBox.Max}");
|
||||
Debug.WriteLine($"CropBox.Min:{viewSection.CropBox.Min}");
|
||||
Debug.WriteLine($"CropBox.Max:{viewSection.CropBox.Max}");
|
||||
|
||||
Debug.WriteLine($"RightDirection:{viewSection.RightDirection}");
|
||||
Debug.WriteLine($"ViewDirection:{viewSection.ViewDirection}");
|
||||
Debug.WriteLine($"RightDirection:{viewSection.RightDirection}");
|
||||
Debug.WriteLine($"ViewDirection:{viewSection.ViewDirection}");
|
||||
|
||||
if (viewSection != null)
|
||||
{
|
||||
uidoc.ActiveView = viewSection;
|
||||
uidoc.Selection.SetElementIds([element.Id]);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (viewSection != null)
|
||||
{
|
||||
uidoc.ActiveView = viewSection;
|
||||
uidoc.Selection.SetElementIds([element.Id]);
|
||||
}
|
||||
}, "创建快速剖面");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
@@ -52,7 +53,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_StructuralFraming), value == false);
|
||||
foreach (var builtInCategory in beamCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"梁显隐"
|
||||
);
|
||||
@@ -73,8 +79,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_CableTray), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_CableTrayFitting), value == false);
|
||||
foreach (var builtInCategory in cabletrayCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"桥架显隐"
|
||||
);
|
||||
@@ -95,8 +105,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_StructuralColumns), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_Columns), value == false);
|
||||
foreach (var builtInCategory in columnsCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"柱显隐"
|
||||
);
|
||||
@@ -117,7 +131,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_Walls), value == false);
|
||||
foreach (var builtInCategory in wallCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"墙显隐"
|
||||
);
|
||||
@@ -138,7 +157,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_Floors), value == false);
|
||||
foreach (var builtInCategory in floorCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"楼板显隐"
|
||||
);
|
||||
@@ -159,8 +183,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_Conduit), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_ConduitFitting), value == false);
|
||||
foreach (var builtInCategory in conduitCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"线管显隐"
|
||||
);
|
||||
@@ -181,9 +209,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_DuctCurves), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_DuctAccessory), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_DuctFitting), value == false);
|
||||
foreach (var builtInCategory in mechanicalCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"暖通显隐"
|
||||
);
|
||||
@@ -204,10 +235,12 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
doc.Invoke(
|
||||
_ =>
|
||||
{
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_PipeCurves), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_PipeFitting), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_PipeAccessory), value == false);
|
||||
uidoc.ActiveView.SetCategoryHidden(new ElementId(BuiltInCategory.OST_Sprinklers), value == false);
|
||||
foreach (var builtInCategory in pipingCategory)
|
||||
{
|
||||
var categoryId = Category.GetCategory(doc, builtInCategory).Id;
|
||||
|
||||
uidoc.ActiveView.SetCategoryHidden(categoryId, value == false);
|
||||
}
|
||||
},
|
||||
"给排水显隐"
|
||||
);
|
||||
@@ -244,6 +277,35 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
}
|
||||
return true;
|
||||
}
|
||||
readonly BuiltInCategory[] wallCategory = [BuiltInCategory.OST_Walls];
|
||||
readonly BuiltInCategory[] beamCategory = [BuiltInCategory.OST_StructuralFraming];
|
||||
readonly BuiltInCategory[] floorCategory = [BuiltInCategory.OST_Floors];
|
||||
readonly BuiltInCategory[] columnsCategory = [
|
||||
BuiltInCategory.OST_StructuralColumns,
|
||||
BuiltInCategory.OST_Columns];
|
||||
readonly BuiltInCategory[] mechanicalCategory = [
|
||||
BuiltInCategory.OST_DuctCurves,
|
||||
BuiltInCategory.OST_DuctAccessory,
|
||||
BuiltInCategory.OST_DuctFitting,
|
||||
BuiltInCategory.OST_DuctInsulations,
|
||||
BuiltInCategory.OST_DuctTerminal,
|
||||
BuiltInCategory.OST_FlexDuctCurves,
|
||||
BuiltInCategory.OST_PlaceHolderDucts,BuiltInCategory.OST_MechanicalEquipment];
|
||||
readonly BuiltInCategory[] pipingCategory = [
|
||||
BuiltInCategory.OST_PipeCurves,
|
||||
BuiltInCategory.OST_PipeFitting,
|
||||
BuiltInCategory.OST_PipeAccessory,
|
||||
BuiltInCategory.OST_PipeInsulations,
|
||||
BuiltInCategory.OST_Sprinklers,
|
||||
BuiltInCategory.OST_FlexPipeCurves,
|
||||
BuiltInCategory.OST_PlaceHolderPipes,
|
||||
BuiltInCategory.OST_PlumbingFixtures];
|
||||
readonly BuiltInCategory[] cabletrayCategory = [
|
||||
BuiltInCategory.OST_CableTray,
|
||||
BuiltInCategory.OST_CableTrayFitting,];
|
||||
readonly BuiltInCategory[] conduitCategory = [
|
||||
BuiltInCategory.OST_Conduit,
|
||||
BuiltInCategory.OST_ConduitFitting,];
|
||||
|
||||
private void UpdateCheckedState(Document doc)
|
||||
{
|
||||
@@ -251,14 +313,14 @@ public partial class VisibilityViewModel : ObservableObject
|
||||
{
|
||||
return;
|
||||
}
|
||||
WallChecked = GetCheckedStatue(doc, BuiltInCategory.OST_Walls);
|
||||
BeamChecked = GetCheckedStatue(doc, BuiltInCategory.OST_StructuralFraming);
|
||||
FloorChecked = GetCheckedStatue(doc, BuiltInCategory.OST_Floors);
|
||||
ColumnChecked = GetCheckedStatue(doc, BuiltInCategory.OST_StructuralColumns, BuiltInCategory.OST_Columns);
|
||||
MechanicalChecked = GetCheckedStatue(doc, BuiltInCategory.OST_DuctCurves, BuiltInCategory.OST_DuctAccessory, BuiltInCategory.OST_DuctFitting);
|
||||
PlumbingChecked = GetCheckedStatue(doc, BuiltInCategory.OST_PipeCurves, BuiltInCategory.OST_PipeFitting, BuiltInCategory.OST_PipeAccessory, BuiltInCategory.OST_Sprinklers);
|
||||
CableTrayChecked = GetCheckedStatue(doc, BuiltInCategory.OST_CableTray, BuiltInCategory.OST_CableTrayFitting);
|
||||
ConduitChecked = GetCheckedStatue(doc, BuiltInCategory.OST_Conduit, BuiltInCategory.OST_ConduitFitting);
|
||||
WallChecked = GetCheckedStatue(doc, wallCategory);
|
||||
BeamChecked = GetCheckedStatue(doc, beamCategory);
|
||||
FloorChecked = GetCheckedStatue(doc, floorCategory);
|
||||
ColumnChecked = GetCheckedStatue(doc, columnsCategory);
|
||||
MechanicalChecked = GetCheckedStatue(doc, mechanicalCategory);
|
||||
PlumbingChecked = GetCheckedStatue(doc, pipingCategory);
|
||||
CableTrayChecked = GetCheckedStatue(doc, cabletrayCategory);
|
||||
ConduitChecked = GetCheckedStatue(doc, conduitCategory);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
||||
Reference in New Issue
Block a user