Browse Source

mxg:添加3个工具命令

mengxiangge 5 years ago
parent
commit
a08eb9fb55

BIN
FWindSoft/Saga.PlugIn/Image/复制指定参数A的值到指定参数B中16.png


BIN
FWindSoft/Saga.PlugIn/Image/复制指定参数A的值到指定参数B中32.png


BIN
FWindSoft/Saga.PlugIn/Image/查询设备所在空间16.png


BIN
FWindSoft/Saga.PlugIn/Image/查询设备所在空间32.png


BIN
FWindSoft/Saga.PlugIn/Image/重命名系统名称16.png


BIN
FWindSoft/Saga.PlugIn/Image/重命名系统名称32.png


+ 91 - 0
FWindSoft/Saga.PlugIn/Other/CopyParameterValue.cs

@@ -0,0 +1,91 @@
+/* ==============================================================================
+ * 功能描述:同步幕墙的本地名称、本地编码到幕墙嵌板中?
+ * 创 建 者:Garrett
+ * 创建日期:2018/7/11 14:34:26
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Autodesk.Revit.DB;
+using Saga.PlugIn.ModelCheck;
+using SAGA.DotNetUtils.Extend;
+using SAGA.DotNetUtils.Others;
+using SAGA.RevitUtils.Extends;
+
+namespace Saga.PlugIn.Other
+{
+    /// <summary>
+    /// CheckEquipInSpace
+    /// </summary>
+    public class CopyParameterValue 
+    {
+        public static string AllStr = "All";
+        private ObservableCollection<PropertyItem> m_parameterDic;
+        private string m_copyFamilyRange;
+        public bool SetCopyParameterDic(ObservableCollection<PropertyItem> dic, string copyRange)
+        {
+
+            m_parameterDic = dic;
+            m_copyFamilyRange = copyRange;
+            return (dic.Any()&&!string.IsNullOrWhiteSpace(m_copyFamilyRange));
+        }
+
+        public string Execute(Document doc)
+        {
+            try
+            {
+                OperateFloor(doc);
+                doc.Save();
+            }
+            catch (Exception e)
+            {
+                MessageShowBase.Show(e);
+            }
+            return null;
+        }
+
+        private void OperateFloor(Document doc)
+        {
+
+            using (Transaction trans = new Transaction(doc, "复制属性"))
+            {
+                try
+                {
+                    trans.Start();
+                    var elements = doc.GetFamilyInstances();
+                    var codes = GetCodes();
+
+                    foreach (Element element in elements)
+                    {
+                        var code = element.GetFamilyCode();
+                        if (codes.Contains(AllStr) || code.Contains(code))
+                            foreach (var pair in m_parameterDic)
+                            {
+                                string origin = pair.Name;
+                                string target = pair.Value;
+                                if (origin.IsNotNullEmpty() && target.IsNotNullEmpty())
+                                {
+                                    element.SetParameterValue(target, element.GetParameterString(origin));
+                                }
+                            }
+                    }
+
+                    trans.Commit();
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e);
+                }
+
+            }
+        }
+
+        private string[] GetCodes()
+        {
+            var codes = m_copyFamilyRange?.Split(';', ';');
+            return codes;
+        }
+    }
+}

+ 113 - 0
FWindSoft/Saga.PlugIn/Other/RenameSystemName.cs

@@ -0,0 +1,113 @@
+/* ==============================================================================
+ * 功能描述:RenameSystemName  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/20 9:11:31
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.DB.Electrical;
+using SAGA.DotNetUtils.Extend;
+using SAGA.DotNetUtils.NPOI;
+using SAGA.DotNetUtils.Others;
+using SAGA.RevitUtils.Extends;
+
+namespace Saga.PlugIn.Other
+{
+    /// <summary>
+    /// RenameSystemName
+    /// </summary>
+    class RenameSystemName 
+    {
+        private static void OperateFloor(string fullPah, List<Ref_RenameSystem> refRenameSystems)
+        {
+            var doc= ExternalDataWrapper.Current.UiApp.Application.OpenDocumentFile(fullPah);
+            using (Transaction trans = new Transaction(doc, "重命名系统名称"))
+            {
+                trans.Start();
+
+                try
+                {
+                    var types = doc.GetElements(typeof(MEPSystemType));
+                    types.AddRange(doc.GetElements(typeof(CableTrayType)));
+                    foreach (ElementType type in types)
+                    {
+                        string typeName = type.Name;
+                        var refPair=refRenameSystems.FirstOrDefault(t => t.OldName == typeName);
+                        if (refPair != null)
+                        {
+                            type.Name = refPair.NewName;
+                        }
+                    }
+
+                    trans.Commit();
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e);
+                    trans.RollBack();
+                }
+            }
+        }
+
+        public void Operate(string referPath,string revitDir)
+        {
+            var refPairs = GetReferencePairs(referPath);
+            if (!refPairs.Any()) return;
+            var list = GetRevitFiles(revitDir);
+            if (!list.Any()) return;
+            foreach (string fullPath in list)
+            {
+                OperateFloor(fullPath, refPairs);
+            }
+        }
+        /// <summary>
+        /// 获取需要修改的Revit文件
+        /// </summary>
+        /// <param name="revitDir"></param>
+        /// <returns></returns>
+        private static List<string> GetRevitFiles(string revitDir)
+        {
+            DirectoryInfo directory=new DirectoryInfo(revitDir);
+            List<string> list=new List<string>();
+            try
+            {
+                list=directory.GetFiles("*.rvt").Where(t=>!t.FullName.Is000File()).Select(t=>t.FullName).ToList();
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e);
+                
+            }
+
+            return list;
+        }
+
+        /// <summary>
+        /// 参考-表
+        /// </summary>Sheet1
+        [SheetInfo(SheetName = "Sheet1", RowStartIndex = 3)]
+        public class Ref_RenameSystem
+        {
+            [CellIndex(2)]
+            public string OldName { get; set; }
+
+            [CellIndex(3)]
+            public string NewName { get; set; }
+        }
+
+        /// <summary>
+        /// 获取可识别的管道系统名称
+        /// </summary>
+        /// <returns></returns>
+        private static List<Ref_RenameSystem> GetReferencePairs(string path)
+        {
+            var list = NPOIHelper
+                .ConvertExcelSheetToModel<Ref_RenameSystem>(path);
+            return list;
+        }
+    }
+}

+ 93 - 0
FWindSoft/Saga.PlugIn/Other/WinParameterDic.xaml

@@ -0,0 +1,93 @@
+<windows:WinBase x:Class="Saga.PlugIn.Other.WinParameterDic"
+             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:windows="clr-namespace:SAGA.RevitUtils.Windows;assembly=SAGA.RevitUtils"
+             mc:Ignorable="d" Title="配置参数" WindowStartupLocation="CenterScreen"
+                  Height="300" Width="400">
+    <Window.Resources>
+        <Style  TargetType="TextBox">
+            <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
+            <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+            <Setter Property="Height" Value="24"></Setter>
+        </Style>
+        <Style TargetType="DataGridColumnHeader">
+            <Setter Property="Height" Value="25"></Setter>
+            <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
+            <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+        </Style>
+        <Style x:Key="dgtextblock">
+            <Setter Property="TextBlock.Height" Value="25"></Setter>
+            <Setter Property="TextBlock.HorizontalAlignment" Value="Center"></Setter>
+        </Style>
+        <Style x:Key="dgtextbox">
+            <Setter Property="TextBox.Height" Value="25"></Setter>
+            <Setter Property="TextBox.HorizontalContentAlignment" Value="Center"></Setter>
+        </Style>
+    </Window.Resources>
+    <Grid Margin="5">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="50"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="50"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <WrapPanel>
+                <Label Content="请输入设备类别(族的四位编码,多个请用分号分割,所有请输入All):"></Label>
+                <TextBox Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid }, Path=ActualWidth}" Text="{Binding Path=CopyRange,UpdateSourceTrigger=PropertyChanged}" HorizontalContentAlignment="Left" ></TextBox>
+            </WrapPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition Width="20"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <DataGrid Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding Path=ParameterDic,UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False" CanUserAddRows="False"
+                      SelectedItem="{Binding Path=SelectItem}">
+                <DataGrid.Columns>
+                    <DataGridTextColumn Header="源参数名称(旧)"  Width="*" Binding="{Binding Path=Name,UpdateSourceTrigger=PropertyChanged}"
+                                       ElementStyle="{StaticResource dgtextblock}" 
+                                        EditingElementStyle="{StaticResource dgtextbox}"></DataGridTextColumn>
+                    <DataGridTextColumn Header="目标参数名称(新)" Width="*" Binding="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged}"
+                                        ElementStyle="{StaticResource dgtextblock}"
+                                        EditingElementStyle="{StaticResource dgtextbox}"></DataGridTextColumn>
+                </DataGrid.Columns>
+            </DataGrid>
+
+            <!--<StackPanel Grid.Column="0">
+                <Label Height="25" Content="源参数名称(旧)" HorizontalContentAlignment="Center" Background="LightGray"></Label>
+                <TextBox Name="txt00" Text="车位编号"></TextBox>
+                <TextBox Name="txt10"></TextBox>
+            </StackPanel>
+            <StackPanel Grid.Column="1">
+                <Label Height="25" Content="目标参数名称(新)" HorizontalContentAlignment="Center" Background="LightGray"></Label>
+                <TextBox  Name="txt01" Text="设备本地编码"></TextBox>
+                <TextBox  Name="txt11"></TextBox>
+            </StackPanel>-->
+            <Grid Grid.Column="2">
+                <StackPanel VerticalAlignment="Center">
+                    <Button Margin="0,5"
+                        Height="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid},Path=ActualWidth}"
+                            Click="BtnAdd_OnClick">
+                        <Image Source="../Image/add.png"></Image>
+                    </Button>
+
+                    <Button Margin="0,5"
+                        Height="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid},Path=ActualWidth}"
+                            Click="BtnDel_OnClick">
+                        <Image Source="../Image/delete.png">
+                        </Image>
+                    </Button>
+
+                </StackPanel>
+            </Grid>
+        </Grid>
+        <WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
+            <Button Height="24" Width="100" Content="执行" Margin="10,0" IsDefault="True" Click="ButtonBase_OnClick"></Button>
+            <Button Height="24" Width="100" Content="取消" Margin="10,0" IsCancel="True"></Button>
+        </WrapPanel>
+    </Grid>
+</windows:WinBase>
+

+ 109 - 0
FWindSoft/Saga.PlugIn/Other/WinParameterDic.xaml.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Linq;
+using System.Windows;
+using Exception = System.Exception;
+
+namespace Saga.PlugIn.Other
+{
+    /// <summary>
+    /// WinParameterDic.xaml 的交互逻辑
+    /// </summary>
+    public partial class WinParameterDic : INotifyPropertyChanged
+    {
+        public WinParameterDic()
+        {
+            InitializeComponent();
+            CopyRange = CopyParameterValue.AllStr;
+            ParameterDic = new ObservableCollection<PropertyItem>();
+            ParameterDic.Add(new PropertyItem() { Name = "车位编号", Value = "设备本地编码" });
+            this.DataContext = this;
+        }
+
+        #region Binding
+
+        private ObservableCollection<PropertyItem> m_ParameterDic;
+
+        public ObservableCollection<PropertyItem> ParameterDic
+        {
+            get { return m_ParameterDic; }
+            set
+            {
+                m_ParameterDic = value;
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ParameterDic)));
+            }
+        }
+
+        private PropertyItem m_SelectItem;
+
+        public PropertyItem SelectItem
+        {
+            get { return m_SelectItem; }
+            set
+            {
+                m_SelectItem = value;
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectItem)));
+            }
+        }
+
+        private string m_CopyRange;
+
+        public string CopyRange
+        {
+            get { return m_CopyRange; }
+            set
+            {
+                m_CopyRange = value;
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CopyRange)));
+            }
+        }
+
+
+        #endregion
+
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
+        {
+            try
+            {
+
+            }
+            catch (Exception exception)
+            {
+                Console.WriteLine(exception);
+
+            }
+
+            this.DialogResult = true;
+        }
+
+
+        private void BtnAdd_OnClick(object sender, RoutedEventArgs e)
+        {
+            var item = ParameterDic.FirstOrDefault(t => t.Name == null && t.Value == null);
+            if (item == null)
+            {
+                item = new PropertyItem();
+                ParameterDic.Add(item);
+            }
+
+            SelectItem = item;
+        }
+
+        private void BtnDel_OnClick(object sender, RoutedEventArgs e)
+        {
+            if (SelectItem != null)
+                ParameterDic.Remove(SelectItem);
+        }
+    }
+
+    public class PropertyItem
+    {
+        public string Name { get; set; }
+
+        public string Value { get; set; }
+    }
+}

+ 55 - 0
FWindSoft/Saga.PlugIn/Other/WinSelectFileFloder.xaml

@@ -0,0 +1,55 @@
+<windows:WinBase x:Class="Saga.PlugIn.Other.WinRenameConfig"
+             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:wpf="clr-namespace:SAGA.DotNetUtils.WPF.UserControl;assembly=SAGA.DotNetUtils"
+        xmlns:windows="clr-namespace:SAGA.RevitUtils.Windows;assembly=SAGA.RevitUtils"
+        mc:Ignorable="d" Title="系统重命名参数设置" WindowStartupLocation="CenterScreen"
+                  Height="200" Width="400">
+    <Window.Resources>
+        <Style  TargetType="TextBox">
+            <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
+            <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+            <Setter Property="Height" Value="24"></Setter>
+        </Style>
+        <Style TargetType="DataGridColumnHeader">
+            <Setter Property="Height" Value="25"></Setter>
+            <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
+            <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+        </Style>
+        <Style x:Key="dgtextblock">
+            <Setter Property="TextBlock.Height" Value="25"></Setter>
+            <Setter Property="TextBlock.HorizontalAlignment" Value="Center"></Setter>
+        </Style>
+        <Style x:Key="dgtextbox">
+            <Setter Property="TextBox.Height" Value="25"></Setter>
+            <Setter Property="TextBox.HorizontalContentAlignment" Value="Center"></Setter>
+        </Style>
+    </Window.Resources>
+    <Grid Margin="5">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="50"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="50"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <StackPanel>
+                <Label Content="请选择重命名系统的参考表:"></Label>
+                <wpf:SelectFile_Hyperlink Height="25" Text="{Binding Path=ReferenceFilePath,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" IsDisplayFullPath="True"></wpf:SelectFile_Hyperlink>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <StackPanel>
+                <Label Content="请选择需要修改的Revit文件夹:"></Label>
+                <wpf:SelectPath Height="25" Text="{Binding Path=RevitDirs,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" ButtonPosition="End"></wpf:SelectPath>
+            </StackPanel>
+        </Grid>
+
+        <WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
+            <Button Height="24" Width="100" Content="执行" Margin="10,0" IsDefault="True" Click="ButtonBase_OnClick"></Button>
+            <Button Height="24" Width="100" Content="取消" Margin="10,0" IsCancel="True"></Button>
+        </WrapPanel>
+    </Grid>
+</windows:WinBase>
+

+ 69 - 0
FWindSoft/Saga.PlugIn/Other/WinSelectFileFloder.xaml.cs

@@ -0,0 +1,69 @@
+using System;
+using System.ComponentModel;
+using System.Windows;
+using Exception = System.Exception;
+
+namespace Saga.PlugIn.Other
+{
+    /// <summary>
+    /// WinParameterDic.xaml 的交互逻辑
+    /// </summary>
+    public partial class WinRenameConfig : INotifyPropertyChanged
+    {
+        public WinRenameConfig()
+        {
+            InitializeComponent();
+            this.DataContext = this;
+        }
+
+        #region Binding
+        
+
+        private string m_ReferenceFilePath;
+
+        public string ReferenceFilePath
+        {
+            get { return m_ReferenceFilePath; }
+            set
+            {
+                m_ReferenceFilePath = value;
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ReferenceFilePath)));
+            }
+        }
+
+        private string m_RevitDirs;
+
+        public string RevitDirs
+        {
+            get { return m_RevitDirs; }
+            set
+            {
+                m_RevitDirs = value;
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(RevitDirs)));
+            }
+        }
+
+
+        #endregion
+
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
+        {
+            try
+            {
+
+            }
+            catch (Exception exception)
+            {
+                Console.WriteLine(exception);
+
+            }
+
+            this.DialogResult = true;
+        }
+
+        
+    }
+}

+ 147 - 0
FWindSoft/Saga.PlugIn/OtherCommand.cs

@@ -0,0 +1,147 @@
+/* ==============================================================================
+ * 功能描述:OtherCommand  
+ * 创 建 者:Garrett
+ * 创建日期:2019/11/26 9:49:59
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using Autodesk.Revit.Attributes;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.UI;
+using FWindSoft.Data;
+using FWindSoft.Revit;
+using FWindSoft.Revit.Menu;
+using Saga.PlugIn.ModelCheck;
+using Saga.PlugIn.Other;
+using SAGA.DotNetUtils.Geometry;
+using SAGA.DotNetUtils.Others;
+using SAGA.RevitUtils;
+using SAGA.RevitUtils.Extends;
+using ExternalCommand = FWindSoft.Revit.ExternalCommand;
+
+namespace LRH.Tool
+{
+    /// <summary>
+    /// 查询设备所在空间
+    /// </summary>
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    [Button(ButtonName = "查询设备所在空间", Index = 1, TabName = "禹数建模工具", PanelName = "工具", ImageName = "pack://application:,,,/Saga.PlugIn;component/Image/查询设备所在空间")]
+    public class ReportEquipInSpaceCommand : ExternalCommand
+    {
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            try
+            {
+
+                var fi = commandData.Application.PickElement("请选择图元") as FamilyInstance;
+                if (fi == null) return Result.Succeeded;
+                var space = fi.GetReferenceSpace();
+                string str = "", str2 = "";
+                do
+                {
+                    if (space != null)
+                    {
+                        List<XYZ> spaceVertex = space.GetBoundaryVertexes().FirstOrDefault();
+                        if (spaceVertex == null)
+                        {
+                            str = "Boundary 为Null";
+                            break;
+                        }
+                    }
+
+                } while (false);
+                MessageShowBase.Infomation($"设备所在空间Id为{space?.Id}");
+            }
+            catch (Exception e)
+            {
+                MessageShow.Show(e);
+                return Result.Cancelled;
+            }
+            return Result.Succeeded;
+        }
+    }
+    /// <summary>
+    /// 复制指定参数A的值到指定参数B中
+    /// </summary>
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    [Button(ButtonName = "复制指定参数A的值到指定参数B中", Index = 2, TabName = "禹数建模工具", PanelName = "工具", ImageName = "pack://application:,,,/Saga.PlugIn;component/Image/复制指定参数A的值到指定参数B中")]
+    public class CopyParameterValueCommand : ExternalCommand
+    {
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            try
+            {
+                var tip = MessageShowBase.Question("确定要复制参数?");
+                if (tip)
+                {
+                    WinParameterDic win = new WinParameterDic();
+
+                    if (win.ShowDialog() == true)
+                    {
+                        if (!SingleInstance<CopyParameterValue>.Instance.SetCopyParameterDic(win.ParameterDic,
+                            win.CopyRange)) return Result.Cancelled;
+                        var doc = RevitCore.Doc;
+                        SingleInstance<CopyParameterValue>.Instance.Execute(doc);
+                        
+                        MessageShowBase.Infomation("信息点的值复制完成");
+                    }
+                }
+
+            }
+            catch (Exception e)
+            {
+                MessageShow.Show(e);
+                return Result.Cancelled;
+            }
+            return Result.Succeeded;
+        }
+
+        public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
+        {
+            return true;
+        }
+    }
+
+    /// <summary>
+    /// 重命名系统名称
+    /// </summary>
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    [Button(ButtonName = "重命名系统名称", Index = 3, TabName = "禹数建模工具", PanelName = "工具", ImageName = "pack://application:,,,/Saga.PlugIn;component/Image/重命名系统名称")]
+    public class RenameSystemNameCommand : ExternalCommand
+    {
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            try
+            {
+                var iDataCorrect = new RenameSystemName();
+                if (true)
+                {
+                    WinRenameConfig win = new WinRenameConfig();
+                    if (win.ShowDialog() == true)
+                    {
+                        iDataCorrect.Operate(win.ReferenceFilePath, win.RevitDirs);
+                        MessageShowBase.Infomation("系统名称已修改,请检查");
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                MessageShow.Show(e);
+                return Result.Cancelled;
+            }
+            return Result.Succeeded;
+        }
+
+        public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
+        {
+            return true;
+        }
+    }
+}

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

@@ -101,6 +101,15 @@
       <DependentUpon>WinTipMissFamily.xaml</DependentUpon>
     </Compile>
     <Compile Include="CreateFacilityCommand.cs" />
+    <Compile Include="OtherCommand.cs" />
+    <Compile Include="Other\CopyParameterValue.cs" />
+    <Compile Include="Other\RenameSystemName.cs" />
+    <Compile Include="Other\WinParameterDic.xaml.cs">
+      <DependentUpon>WinParameterDic.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Other\WinSelectFileFloder.xaml.cs">
+      <DependentUpon>WinSelectFileFloder.xaml</DependentUpon>
+    </Compile>
     <Compile Include="VerticalPipeCheckCommand.cs" />
     <Compile Include="ModelCheckCommand.cs" />
     <Compile Include="ModelCheck\ModelCheckConverter.cs" />
@@ -157,6 +166,24 @@
     <Resource Include="ModelCheck\Image\错误.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Resource>
+    <Resource Include="Image\复制指定参数A的值到指定参数B中16.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\复制指定参数A的值到指定参数B中32.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\查询设备所在空间16.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\查询设备所在空间32.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\重命名系统名称16.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Image\重命名系统名称32.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
     <Content Include="VerticalPipeCheck\ExcelTemplate\立管对齐检查-模板.xlsx">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
@@ -249,6 +276,14 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Other\WinParameterDic.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Other\WinSelectFileFloder.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="VerticalPipeCheck\WinVecticalPipeCheck.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>