ソースを参照

mxg:添加立管检查和图元重复检查

mengxiangge 5 年 前
コミット
e61185983a

+ 1 - 1
FWindSoft/Saga.PlugIn/CreateFacilityCommand.cs

@@ -16,7 +16,7 @@ namespace Saga.PlugIn
 {
     [Transaction(TransactionMode.Manual)]
     [Regeneration(RegenerationOption.Manual)]
-    [Button(ButtonName = "待建模设备", Index = -1)]
+    [Button(ButtonName = "待建模设备", Index = -1, PanelName = "禹数建模工作", GroupName = "完善设备设施模型")]
     public class CreateFacilityCommand : ExternalCommand
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)

BIN
FWindSoft/Saga.PlugIn/Image/上一层.png


BIN
FWindSoft/Saga.PlugIn/Image/下一层.png


BIN
FWindSoft/Saga.PlugIn/Image/进度条.gif


+ 2 - 1
FWindSoft/Saga.PlugIn/ModelCheck/CheckOperation.cs

@@ -10,6 +10,7 @@ using System.Linq;
 using System.Reflection;
 using Autodesk.Revit.DB;
 using Autodesk.Revit.UI;
+using FWindSoft.Wpf;
 using NPOI.SS.UserModel;
 using SAGA.DotNetUtils.Extend;
 using SAGA.DotNetUtils.Others;
@@ -77,7 +78,7 @@ namespace Saga.PlugIn.ModelCheck
             {
                 t.Check2(doc);
                 vm.CurrentIndex++;
-                vm.Win.DoEvents();
+                WpfSysCmd.DoEvent();
             });
 
             //重置workbook准备保存结果

+ 4 - 7
FWindSoft/Saga.PlugIn/ModelCheck/VMModelCheck.cs

@@ -4,15 +4,14 @@
  * 创建日期:2018/11/29 14:43:26
  * ==============================================================================*/
 
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.IO;
 using Autodesk.Revit.DB;
-using Saga.PlugIn.CreateFacility;
 using SAGA.DotNetUtils.Extend;
 using SAGA.DotNetUtils.WPF;
 using SAGA.RevitUtils;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using Saga.PlugIn.CreateFacility;
 
 namespace Saga.PlugIn.ModelCheck
 {
@@ -112,7 +111,6 @@ namespace Saga.PlugIn.ModelCheck
                 NotifyPropertyChanged("CurrentIndex");
             }
         }
-        public WinModeCheck Win { get; set; }
 
         [Command]
         public void Execute(object param)
@@ -122,7 +120,6 @@ namespace Saga.PlugIn.ModelCheck
                 switch (ModelCheckState)
                 {
                     case ModelCheckState.Prepare:
-                        Win = param as WinModeCheck;
                         CheckItems.ForEach(t => t.ModelCheckState = ModelCheckState.Progress);
                         ModelCheckState = ModelCheckState.Progress;
                         string savePath = Path.Combine(SaveDir,

+ 1 - 20
FWindSoft/Saga.PlugIn/ModelCheck/WinModeCheck.xaml.cs

@@ -50,26 +50,7 @@ namespace Saga.PlugIn.ModelCheck
             }
         }
 
-        public void DoEvents()
-        {
-            var frame = new DispatcherFrame();
-            Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
-                new DispatcherOperationCallback(ExitFrames), frame);
-            try
-            {
-                Dispatcher.PushFrame(frame);
-            }
-            catch (InvalidOperationException)
-            {
-            }
-        }
-
-        private object ExitFrames(object frame)
-        {
-            ((DispatcherFrame) frame).Continue = false;
-            return null;
-
-        }
+       
     }
 }
 

+ 1 - 1
FWindSoft/Saga.PlugIn/ModelCheckCommand.cs

@@ -16,7 +16,7 @@ namespace Saga.PlugIn
 {
     [Transaction(TransactionMode.Manual)]
     [Regeneration(RegenerationOption.Manual)]
-    [Button(ButtonName = "建模规范检查", Index = -1)]
+    [Button(ButtonName = "建模规范检查", Index = -1, PanelName = "禹数建模工作", GroupName = "模型检查")]
     public class ModelCheckCommand : ExternalCommand
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)

+ 29 - 0
FWindSoft/Saga.PlugIn/Saga.PlugIn.csproj

@@ -73,6 +73,9 @@
     <Reference Include="System.Net.Http" />
     <Reference Include="System.Xml" />
     <Reference Include="WindowsBase" />
+    <Reference Include="XamlAnimatedGif, Version=1.2.2.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\XamlAnimatedGif.1.2.2\lib\net45\XamlAnimatedGif.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="CreateFacility\CreateFacilityConst.cs" />
@@ -96,6 +99,7 @@
       <DependentUpon>WinTipMissFamily.xaml</DependentUpon>
     </Compile>
     <Compile Include="CreateFacilityCommand.cs" />
+    <Compile Include="VerticalPpeCheckCommand.cs" />
     <Compile Include="ModelCheckCommand.cs" />
     <Compile Include="ModelCheck\ModelCheckConverter.cs" />
     <Compile Include="ModelCheck\InstanceLocationOverlapCheck.cs" />
@@ -132,6 +136,14 @@
       <DependentUpon>WinTipCheckComplete.xaml</DependentUpon>
     </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="VerticalPipeCheck\VerticalPipeUtil.cs" />
+    <Compile Include="VerticalPipeCheck\VmVerticalPipeCheck.cs" />
+    <Compile Include="VerticalPipeCheck\WinVecticalPipeCheck.xaml.cs">
+      <DependentUpon>WinVecticalPipeCheck.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="VerticalPipeCheck\WinTipVPipeCheckComplete.xaml.cs">
+      <DependentUpon>WinTipVPipeCheckComplete.xaml</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <Resource Include="ModelCheck\Image\叉.png">
@@ -146,6 +158,15 @@
     <Resource Include="CreateFacility\Image\错误.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Resource>
+    <Resource Include="Image\进度条.gif">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\上一层.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\下一层.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
     <Content Include="ModelCheck\ExcelTemplate\模型检查结果输出格式-模版.xlsx">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
@@ -199,6 +220,14 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="VerticalPipeCheck\WinVecticalPipeCheck.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="VerticalPipeCheck\WinTipVPipeCheckComplete.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Resource Include="ModelCheck\Image\对勾.png" />

+ 195 - 0
FWindSoft/Saga.PlugIn/VerticalPipeCheck/VerticalPipeUtil.cs

@@ -0,0 +1,195 @@
+/* ==============================================================================
+ * 功能描述:VerticalPipeUtil  
+ * 创 建 者:Garrett
+ * 创建日期:2019/11/5 15:35:20
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Autodesk.Revit.DB;
+using FWindSoft.Revit;
+using NPOI.SS.UserModel;
+using Saga.PlugIn.ModelCheck;
+using SAGA.DotNetUtils;
+using SAGA.DotNetUtils.Extend;
+using SAGA.DotNetUtils.Others;
+using SAGA.RevitUtils.MEP;
+
+namespace Saga.PlugIn.VerticalPipeCheck
+{
+    /// <summary>
+    /// VerticalPipeUtil
+    /// </summary>
+    class VerticalPipeUtil
+    {
+        public static Tuple<int,int> Execute(string upPath,string downPath,string savePath)
+        {
+            try
+            {
+                var upPipes = GetVerticalMEPCurves(upPath,true);
+                var downPipes = GetVerticalMEPCurves(downPath, false);
+                Action<List<VerticalPipe>, List<VerticalPipe>, string, bool> check = (pipes1, pipes2, path, isup) =>
+                {
+                    string fileName = path.GetFileName();
+                    foreach (VerticalPipe pipe in pipes1)
+                    {
+                        var pipes = pipes2.Where(t => t.OpenXyz.IsAlmostEqualTo(pipe.OpenXyz));
+                        if (pipes.Any())
+                        {
+                            pipe.TargetFileName = fileName;
+                            pipe.TargetPath = path;
+                            pipe.IsRight = true;
+                            string tip = isup ? "下" : "上";
+                            pipe.RMessage = $"在{tip}层相应位置到了对应的立管。Id:{pipes.FirstOrDefault().MepCurve.Id}";
+                        }
+                        else
+                        {
+                            pipe.TargetFileName = fileName;
+                            pipe.TargetPath = path;
+                            pipe.IsRight = false;
+                            string tip = isup ? "下" : "上";
+                            pipe.RMessage = $"在{tip}层相应位置找不到对应的立管,请检查模型";
+                        }
+                    }
+                };
+                check(upPipes, downPipes, downPath, true);
+                check(downPipes, upPipes, upPath, false);
+                List<VerticalPipe> results=new List<VerticalPipe>(upPipes);
+                results.AddRange(downPipes);
+                results.Sort(new CommonComparer<VerticalPipe>((x, y) => {return x.IsRight.CompareTo(y.IsRight); }));
+
+                #region Save
+
+                //重置workbook准备保存结果
+                DCRExport.ClearWorkbook();
+                //保存
+                ExportResult(results);
+                DCRExport.Save(savePath, DCRExport.GetWorkbook());
+                return new Tuple<int, int>(upPipes.Count,downPipes.Count);
+                #endregion
+            }
+            catch (Exception e)
+            {
+                MessageShowBase.Show(e);
+            }
+
+            return null;
+        }
+        /// <summary>
+        /// 获取所有的立管
+        /// </summary>
+        /// <param name="path"></param>
+        /// <param n
+        /// ame="isup"></param>
+        /// <returns></returns>
+        public static List<VerticalPipe> GetVerticalMEPCurves(string path,bool isup)
+        {
+            var doc=RevitCore.App.OpenDocumentFile(path);
+            string fileName = path.GetFileName();
+            var mepcurves = doc.GetElements<MEPCurve>();
+            List<VerticalPipe> verticalPipes=new List<VerticalPipe>();
+            foreach (MEPCurve mepCurve in mepcurves)
+            {
+                bool result = false;
+                var curve = mepCurve.GetLocationCurve();
+                if (curve is Line line)
+                {
+                    if (line.Direction.IsParallel(XYZ.BasisZ))
+                    {
+                        var start = line.StartPoint();
+                        var end = line.EndPoint();
+                        XYZ point = null;
+                        if (isup)
+                        {
+                            point = start.Z.IsThan(end.Z) ? start : end;
+                        }
+                        else
+                        {
+                            point = start.Z.IsThan(end.Z) ? end : start;
+                        }
+                        Connector connector = mepCurve.GetNearConnector(point);
+                        if (!connector.IsConnected)
+                        {
+                            VerticalPipe verticalPipe=new VerticalPipe();
+                            verticalPipe.MepCurve = mepCurve;
+                            verticalPipe.OpenXyz = point;
+                            verticalPipe.Path = path;
+                            verticalPipe.FileName = fileName;
+                            verticalPipes.Add(verticalPipe);
+                        }
+                    }
+                }
+            }
+            return verticalPipes;
+        }
+
+        /// <summary>
+        /// 检查结果汇总
+        /// </summary>
+        /// <param name="list"></param>
+        /// <param name="context"></param>
+        private static void ExportResult(List<VerticalPipe> list)
+        {
+            try
+            {
+                IWorkbook book = DCRExport.GetWorkbook();
+                string sheetName = "立管对齐检查";
+                ISheet sheet = book.GetSheet(sheetName);
+
+                #region 添加数据
+                int index = 3;
+                //添加 共检查XXX条数据,未通过检查的如下 提示
+                IRow rowTip = sheet.CreateRow(index - 1);
+                //rowTip.AddCell(0, $"总检查{list.Count}条数据,未通过检查的如下", DataCheckNPOIStyle.Title);
+                foreach (var result in list)
+                {
+                    if (result.IsRight) continue;
+                    index++;
+                    IRow rowN = sheet.CreateRow(index);
+                    DataCheckNPOIStyle style = result.IsRight ? DataCheckNPOIStyle.Content : DataCheckNPOIStyle.Error;
+                    int j = -1;
+                    rowN.AddCell(++j, result.FileName, style);
+                    rowN.AddCell(++j, result.Path, style);
+                    rowN.AddCell(++j, result.MepCurve.Id.ToString(), style);
+                    rowN.AddCell(++j, result.MepCurve.GetSystemTypeName(), style);
+                    rowN.AddCell(++j, result.TargetFileName, style);
+                    rowN.AddCell(++j, result.TargetPath, style);
+                    string rowN4 = result.IsRight ? "通过" : "不通过";
+                    rowN.AddCell(++j, rowN4, style);
+                    rowN.AddCell(++j, result.RMessage, style);
+                }
+                #endregion
+
+
+            }
+            catch (Exception e)
+            {
+                MessageShowBase.Show(e);
+            }
+        }
+    }
+
+    class VerticalPipe
+    {
+        public MEPCurve MepCurve { get; set; }
+        public XYZ OpenXyz { get; set; }
+
+        public string Path { get; set; }
+
+        public string FileName { get; set; }
+
+        public string TargetPath { get; set; }
+        public string TargetFileName { get; set; }
+
+        /// <summary>
+        /// 是否通过较验
+        /// </summary>
+        public bool IsRight { get; set; }
+        /// <summary>
+        /// 提示信息
+        /// </summary>
+        public string RMessage { get; set; }
+    }
+}

+ 129 - 0
FWindSoft/Saga.PlugIn/VerticalPipeCheck/VmVerticalPipeCheck.cs

@@ -0,0 +1,129 @@
+/* ==============================================================================
+ * 功能描述:VmVerticalPipeCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/11/5 15:25:33
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using FWindSoft.Wpf;
+using Saga.PlugIn.CreateFacility;
+using Saga.PlugIn.ModelCheck;
+using SAGA.DotNetUtils.WPF;
+using SAGA.RevitUtils;
+
+namespace Saga.PlugIn.VerticalPipeCheck
+{
+    /// <summary>
+    /// VmVerticalPipeCheck
+    /// </summary>
+    public class VmVerticalPipeCheck:BaseViewModelStub
+    {
+        #region Property
+        private string m_UpFilePath;
+        /// <summary>
+        ///
+        /// </summary>
+        public string UpFilePath
+        {
+            get { return m_UpFilePath; }
+            set
+            {
+                m_UpFilePath = value;
+                NotifyPropertyChanged("UpFilePath");
+            }
+        }
+        private string m_DownFilePath;
+        /// <summary>
+        /// 
+        /// </summary>
+        public string DownFilePath
+        {
+            get { return m_DownFilePath; }
+            set
+            {
+                m_DownFilePath = value;
+                NotifyPropertyChanged("DownFilePath");
+            }
+        }
+        private string m_SaveDir;
+        /// <summary>
+        /// 保存路径
+        /// </summary>
+        public string SaveDir
+        {
+            get { return m_SaveDir; }
+            set
+            {
+                m_SaveDir = value;
+                NotifyPropertyChanged("SaveDir");
+            }
+        }
+        private string m_SavePath;
+        /// <summary>
+        /// 保存路径
+        /// </summary>
+        public string SavePath
+        {
+            get { return m_SavePath; }
+            set
+            {
+                m_SavePath = value;
+                NotifyPropertyChanged("SavePath");
+            }
+        }
+        private ModelCheckState m_ModelCheckState;
+
+        public ModelCheckState ModelCheckState
+        {
+            get { return m_ModelCheckState; }
+            set
+            {
+                m_ModelCheckState = value;
+                NotifyPropertyChanged(nameof(ModelCheckState));
+            }
+        }
+        #endregion
+
+        [Command]
+        public void Execute(object param)
+        {
+            try
+            {
+                switch (ModelCheckState)
+                {
+                    case ModelCheckState.Prepare:
+                        WpfSysCmd.DoEvent();
+                        ModelCheckState = ModelCheckState.Progress;
+                        string savePath = Path.Combine(SaveDir,
+                            $"{"模型规范检查报告"}{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx");
+                        var tuple=VerticalPipeUtil.Execute(UpFilePath,DownFilePath,savePath);
+                        ModelCheckState = ModelCheckState.Ending;
+                        //为了Ending的界面显示,出问题注释掉
+                        SavePath = savePath;
+                        WinTipVPipeCheckComplete win = new WinTipVPipeCheckComplete(tuple?.Item1,tuple?.Item2);
+                        win.ShowDialog();
+                        WpfSysCmd.DoEvent();
+                        break;
+                    case ModelCheckState.Progress:
+                        break;
+                    case ModelCheckState.Ending:
+                        System.Diagnostics.Process.Start("explorer.exe", SaveDir);
+                        break;
+                }
+            }
+            catch (Exception e)
+            {
+                MessageShow.Show(e);
+            }
+
+        }
+        public bool CanExecute(object param)
+        {
+            return ModelCheckState.Progress != ModelCheckState;
+        }
+    }
+}

+ 47 - 0
FWindSoft/Saga.PlugIn/VerticalPipeCheck/WinTipVPipeCheckComplete.xaml

@@ -0,0 +1,47 @@
+<Window x:Class="Saga.PlugIn.VerticalPipeCheck.WinTipVPipeCheckComplete"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             mc:Ignorable="d" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
+             Height="300" Width="450"
+        Title="提示">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="60"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition></RowDefinition>
+                <RowDefinition></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="100"></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Image Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10,0"
+                   Source="../CreateFacility/Image/成功.png"></Image>
+            <Label Grid.Row="0" Grid.Column="1" Content="立管连接检查已完成"
+                   FontSize="20" FontWeight="UltraBlack"
+                   VerticalAlignment="Bottom"></Label>
+            <StackPanel Grid.Row="1" Grid.Column="1">
+                <WrapPanel>
+                    <Label Content="上层立管"></Label>
+                    <Label Content="{Binding Path=UpCount}"></Label>
+                    <Label Content="个"></Label>
+                </WrapPanel>
+                <WrapPanel>
+                    <Label Content="下层立管"></Label>
+                    <Label Content="{Binding Path=DownCount}"></Label>
+                    <Label Content="个"></Label>
+                </WrapPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" Background="LightGray">
+            <Button Width="100" Height="25" Background="Black"  Foreground="White" Content="确认"
+                    HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center" 
+                    Click="ButtonNext_OnClick" ></Button>
+        </Grid>
+    </Grid>
+</Window>

+ 43 - 0
FWindSoft/Saga.PlugIn/VerticalPipeCheck/WinTipVPipeCheckComplete.xaml.cs

@@ -0,0 +1,43 @@
+using System.Windows;
+
+namespace Saga.PlugIn.VerticalPipeCheck
+{
+    /// <summary>
+    /// WinTipMissFamily.xaml 的交互逻辑
+    /// </summary>
+    public partial class WinTipVPipeCheckComplete
+    {
+
+        public WinTipVPipeCheckComplete(int? upcount,int? downcount)
+        {
+            InitializeComponent();
+            this.UpCount = upcount;
+            this.DownCount = downcount;
+
+            this.DataContext = this;
+        }
+        private int? m_UpCount;
+
+        public int? UpCount
+        {
+            get { return m_UpCount; }
+            set { m_UpCount = value; }
+        }
+        private int? m_DownCount;
+
+        public int? DownCount
+        {
+            get { return m_DownCount; }
+            set { m_DownCount = value; }
+        }
+
+        #region Action
+
+        private void ButtonNext_OnClick(object sender, RoutedEventArgs e)
+        {
+            this.DialogResult = true;
+        }
+        #endregion
+
+    }
+}

+ 156 - 0
FWindSoft/Saga.PlugIn/VerticalPipeCheck/WinVecticalPipeCheck.xaml

@@ -0,0 +1,156 @@
+<Window x:Class="Saga.PlugIn.VerticalPipeCheck.WinVecticalPipeCheck"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:local="clr-namespace:Saga.PlugIn.ModelCheck"
+        xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"
+             mc:Ignorable="d"  Title="立管检查" WindowStartupLocation="CenterScreen"
+        ResizeMode="NoResize" SizeToContent="WidthAndHeight"
+        Height="Auto" Width="600">
+    <Window.Resources>
+        <local:ItemImageVisibleConverter x:Key="ItemImageEqualVisibleConverter" IsEqualCollapsed="True"></local:ItemImageVisibleConverter>
+        <local:ItemImageVisibleConverter x:Key="ItemImageUnEqualVisibleConverter" IsEqualCollapsed="False"></local:ItemImageVisibleConverter>
+        <local:ItemImageConverter x:Key="ItemImageConverter" ></local:ItemImageConverter>
+    </Window.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"></RowDefinition>
+            <RowDefinition Height="Auto"></RowDefinition>
+            <RowDefinition Height="Auto"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <StackPanel>
+                <Label Margin="10,10,0,0" Content="请选择相邻两层模型,进行立管连接检查"></Label>
+                <Grid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="100"></ColumnDefinition>
+                        <ColumnDefinition Width="*"></ColumnDefinition>
+                        <ColumnDefinition Width="100"></ColumnDefinition>
+                    </Grid.ColumnDefinitions>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="10" ></RowDefinition>
+                        <RowDefinition Height="25" ></RowDefinition>
+                        <RowDefinition Height="10" ></RowDefinition>
+                        <RowDefinition Height="25"></RowDefinition>
+                    </Grid.RowDefinitions>
+                    <Image Grid.Row="1" Grid.Column="0"
+                           Source="../Image/上一层.png"></Image>
+                    <TextBox Grid.Row="1" Grid.Column="1" Name="TxtUpPath"
+                             Text="{Binding Path=UpFilePath,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"></TextBox>
+                    <Button Grid.Row="1" Grid.Column="2" Click="BtnSelectFileUp_OnClick" Content="选择"
+                            Margin="10,0,5,0"></Button>
+                    <Image Grid.Row="3" Grid.Column="0"
+                           Source="../Image/下一层.png"></Image>
+                    <TextBox Grid.Row="3" Grid.Column="1" Name="TxtDownPath"
+                             Text="{Binding Path=DownFilePath,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"></TextBox>
+                    <Button Grid.Row="3" Grid.Column="2" Click="BtnSelectFileDown_OnClick" Content="选择"
+                            Margin="10,0,5,0"></Button>
+                </Grid>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <!--虚线-->
+            <Line X1="10" Y1="15" X2="590" Y2="15" StrokeDashArray="3" Stroke="LightGray" StrokeThickness="2"></Line>
+        </Grid>
+        <Grid Grid.Row="2" >
+            <Grid.RowDefinitions>
+                <RowDefinition></RowDefinition>
+                <RowDefinition></RowDefinition>
+                <RowDefinition></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0"  Visibility="{Binding Path=ModelCheckState,
+                                    Converter={StaticResource ItemImageUnEqualVisibleConverter},
+                                            ConverterParameter={x:Static local:ModelCheckState.Prepare}}">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="40"></RowDefinition>
+                    <RowDefinition Height="40"></RowDefinition>
+                    <RowDefinition Height="60"></RowDefinition>
+                </Grid.RowDefinitions>
+                <Grid Grid.Row="0" Margin="5,8,0,2">
+                    <Label Margin="10,0,0,0" Content="检查结果储存位置:" VerticalAlignment="Center" Foreground="LightGray"></Label>
+                </Grid>
+                <Grid Grid.Row="1" Margin="5,3,0,8">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="*"></ColumnDefinition>
+                        <ColumnDefinition Width="100"></ColumnDefinition>
+                    </Grid.ColumnDefinitions>
+                    <TextBox Margin="10,0,0,0" VerticalContentAlignment="Center" Height="25" 
+                             Name="txtPath"
+                             Text="{Binding Path=SaveDir,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" 
+                             VerticalAlignment="Center"></TextBox>
+                    <Button Grid.Column="1" Content="浏览" Height="25" Margin="10,0,5,0"
+                            Click="SelectDir_OnClick"></Button>
+                </Grid>
+                <Grid Grid.Row="2" Background="LightGray">
+                    <Button Width="100" Height="25" Background="Black"  Foreground="White" Content="开始检查" 
+                            HorizontalAlignment="Right" 
+                            Margin="0,0,5,0" VerticalAlignment="Center"
+                            Command="{Binding Path=Commands.Execute}" 
+                            CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window,Mode=FindAncestor}}"
+                            ></Button>
+                </Grid>
+            </Grid>
+            <Grid Grid.Row="1"  Visibility="{Binding Path=ModelCheckState,
+                                    Converter={StaticResource ItemImageUnEqualVisibleConverter},
+                                            ConverterParameter={x:Static local:ModelCheckState.Progress}}">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="30"></RowDefinition>
+                    <RowDefinition Height="40"></RowDefinition>
+                    <RowDefinition Height="60"></RowDefinition>
+                </Grid.RowDefinitions>
+                <Grid Grid.Row="0" Margin="5,0">
+                </Grid>
+                <Grid Grid.Row="1" Margin="15,0">
+                    <Image Height="15"  gif:AnimationBehavior.SourceUri="../Image/进度条.gif" />
+                </Grid>
+                <Grid Grid.Row="2" Background="LightGray">
+                    <Button Width="100" Height="25" 
+                            Content="检查中..." IsEnabled="False"
+                            HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center" 
+                            ></Button>
+                </Grid>
+            </Grid>
+            <Grid Grid.Row="2"  Visibility="{Binding Path=ModelCheckState,
+                                    Converter={StaticResource ItemImageUnEqualVisibleConverter},
+                                            ConverterParameter={x:Static local:ModelCheckState.Ending}}">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="30"></RowDefinition>
+                    <RowDefinition Height="40"></RowDefinition>
+                    <RowDefinition Height="60"></RowDefinition>
+                </Grid.RowDefinitions>
+                <Grid Grid.Row="0" Margin="5,0">
+                    <Label Content="当前校验结果:" VerticalAlignment="Center" Foreground="LightGray"></Label>
+                </Grid>
+                <Grid Grid.Row="1"  Margin="5,0">
+                    <TextBlock Margin="10,0"  Height="30" Text="{Binding Path=SavePath}"
+                                VerticalAlignment="Center"></TextBlock>
+                </Grid>
+                <Grid Grid.Row="2" Background="LightGray">
+                    <Button Width="120" Height="25" Background="White"  Foreground="Black" Content="打开文件位置" 
+                            HorizontalAlignment="Right" Margin="0,0,115,0" VerticalAlignment="Center" 
+                            Command="{Binding Path=Commands.Execute}" 
+                            ></Button>
+                    <Button Width="100" Height="25" Background="Black"  Foreground="White" Content="继续检查"
+                            HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center" 
+                            Click="ButtonNext_OnClick" ></Button>
+                </Grid>
+            </Grid>
+        </Grid>
+    </Grid>
+</Window>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 68 - 0
FWindSoft/Saga.PlugIn/VerticalPipeCheck/WinVecticalPipeCheck.xaml.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Windows;
+using System.Windows.Forms;
+using System.Windows.Threading;
+using Saga.PlugIn.ModelCheck;
+
+namespace Saga.PlugIn.VerticalPipeCheck
+{
+    /// <summary>
+    /// WinModeCheckSetting.xaml 的交互逻辑
+    /// </summary>
+    public partial class WinVecticalPipeCheck
+    {
+        public WinVecticalPipeCheck(VmVerticalPipeCheck viewmodel)
+        {
+            InitializeComponent();
+            this.DataContext = viewmodel;
+        }
+
+
+        #region BindingProperty
+
+        #endregion
+
+
+        #region Action
+
+        private void ButtonNext_OnClick(object sender, RoutedEventArgs e)
+        {
+            this.DialogResult = true;
+        }
+
+        private void SelectDir_OnClick(object sender, RoutedEventArgs e)
+        {
+            FolderBrowserDialog dialog = new FolderBrowserDialog();
+            dialog.Description = "请选择文件路径";
+
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                txtPath.Text = dialog.SelectedPath;
+            }
+        }
+
+        private void BtnSelectFileDown_OnClick(object sender, RoutedEventArgs e)
+        {
+            OpenFileDialog dialog = new OpenFileDialog();
+
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                TxtDownPath.Text = dialog.FileName;
+            }
+        }
+
+        private void BtnSelectFileUp_OnClick(object sender, RoutedEventArgs e)
+        {
+            OpenFileDialog dialog = new OpenFileDialog();
+
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                TxtUpPath.Text = dialog.FileName;
+            }
+        }
+        #endregion
+
+
+    }
+}
+

+ 31 - 0
FWindSoft/Saga.PlugIn/VerticalPpeCheckCommand.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using FWindSoft.Revit;
+using Autodesk.Revit.Attributes;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.UI;
+using FWindSoft.Revit.ExtensibleStorage;
+using FWindSoft.Revit.Menu;
+using Saga.PlugIn.CreateFacility;
+using Saga.PlugIn.ModelCheck;
+using Saga.PlugIn.VerticalPipeCheck;
+
+namespace Saga.PlugIn
+{
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    [Button(ButtonName = "立管检查", Index = -1,PanelName = "禹数建模工作",GroupName = "模型检查")]
+    public class VerticalPpeCheckCommand : ExternalCommand
+    {
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            VmVerticalPipeCheck viewModel=new VmVerticalPipeCheck();
+            WinVecticalPipeCheck win=new WinVecticalPipeCheck(viewModel);
+            win.ShowDialog();
+            return Result.Succeeded;
+        }
+    }
+}

+ 1 - 0
FWindSoft/Saga.PlugIn/packages.config

@@ -3,4 +3,5 @@
   <package id="Newtonsoft.Json" version="10.0.1" targetFramework="net461" />
   <package id="NPOI" version="2.2.1" targetFramework="net461" />
   <package id="SharpZipLib" version="0.86.0" targetFramework="net461" />
+  <package id="XamlAnimatedGif" version="1.2.2" targetFramework="net461" />
 </packages>