大量更新
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.Attributes;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
@@ -9,14 +13,6 @@ using Newtonsoft.Json;
|
||||
|
||||
using Nice3point.Revit.Toolkit.External;
|
||||
|
||||
using System;
|
||||
|
||||
using System.Data;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
using System.Windows;
|
||||
|
||||
using Szmedi.RvKits.ExportFamilyInfo;
|
||||
|
||||
namespace Szmedi.RvKits.FamilyTools
|
||||
@@ -499,126 +495,5 @@ namespace Szmedi.RvKits.FamilyTools
|
||||
ExportOption(saveDirChoosed, filesFullPathChoosed, famdoc, views, forward);
|
||||
//ExportOption(ps, saveDirChoosed, filesFullPathChoosed, famdoc, views);
|
||||
}
|
||||
//private void TableToExcel(string fullName, DataTable dt, string DirChoosed)
|
||||
//{
|
||||
// IWorkbook workbook;
|
||||
// Configuration config = new Configuration();
|
||||
// //<2F><>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>
|
||||
// string safefilename = Path.GetFileNameWithoutExtension(fullName);
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
||||
// string ExcelWithoutEx = DirChoosed + "\\" + safefilename + "\\" + safefilename + "-" + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
// //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC>
|
||||
// string fileDir = DirChoosed + "\\" + safefilename + "\\";
|
||||
// //<2F><><EFBFBD><EFBFBD>Ŀ¼
|
||||
// DirectoryInfo fileDirInfo = new DirectoryInfo(fileDir);
|
||||
// if (!fileDirInfo.Exists)
|
||||
// {
|
||||
// fileDirInfo.Create();
|
||||
// }
|
||||
// string filename = null;
|
||||
// string ver = config.GetConfig(Selection.ExcelVersion);
|
||||
|
||||
// //if (ver == "Excel <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.xlsx)")
|
||||
// //{
|
||||
|
||||
// // workbook = new XSSFWorkbook();
|
||||
// // filename = ExcelWithoutEx + ".xlsx";
|
||||
|
||||
// //}
|
||||
// if (ver == "Excel 97-2003 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.xls)")
|
||||
// {
|
||||
// workbook = new HSSFWorkbook();
|
||||
// filename = ExcelWithoutEx + ".xls";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// workbook = null;
|
||||
// }
|
||||
// //using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
|
||||
// //{
|
||||
// // //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ݶ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ı<EFBFBD><C4B1>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD>2007<30><37><EFBFBD><EFBFBD>2003<30>湤<EFBFBD><E6B9A4>book
|
||||
// // workbook = WorkbookFactory.Create(fileName);
|
||||
// // fileStream.Close();
|
||||
// //}
|
||||
// if (workbook == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// ISheet sheet = string.IsNullOrEmpty(dt.TableName) ? workbook.CreateSheet("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>") : workbook.CreateSheet(dt.TableName);
|
||||
|
||||
// ICellStyle style = workbook.CreateCellStyle();
|
||||
// //style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// //style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// //style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// //style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// IFont font = workbook.CreateFont();
|
||||
// font.FontHeightInPoints = 14;
|
||||
// //font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold;
|
||||
// font.FontName = "<22><><EFBFBD><EFBFBD>";
|
||||
// style.SetFont(font);//HEAD <20><>ʽ
|
||||
|
||||
// //<2F><>ͷ
|
||||
// IRow row = sheet.CreateRow(0);
|
||||
// for (int i = 0; i < dt.Columns.Count; i++)
|
||||
// {
|
||||
// //ICellStyle ics = workbook.CreateCellStyle();
|
||||
// //ics.FillPattern = NPOI.SS.UserModel.FillPattern.SolidForeground;
|
||||
// //cell.CellStyle = ics;
|
||||
// ICell cell = row.CreateCell(i);
|
||||
|
||||
// cell.SetCellValue(dt.Columns[i].ColumnName);
|
||||
// }
|
||||
|
||||
// //<2F><><EFBFBD><EFBFBD>
|
||||
// for (int i = 0; i < dt.Rows.Count; i++)
|
||||
// {
|
||||
// IRow row1 = sheet.CreateRow(i + 1);
|
||||
// for (int j = 0; j < dt.Columns.Count; j++)
|
||||
// {
|
||||
|
||||
// ICell cell = row1.CreateCell(j);
|
||||
// if (dt.Rows[i][0].ToString() == "")
|
||||
// {
|
||||
// cell.CellStyle = style;
|
||||
// //IFont f = workbook.CreateFont();
|
||||
// //f.FontHeightInPoints = 14;
|
||||
// //cell.CellStyle.SetFont(f);
|
||||
// }
|
||||
// cell.SetCellValue(dt.Rows[i][j].ToString());
|
||||
// }
|
||||
// }
|
||||
|
||||
// //תΪ<D7AA>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// MemoryStream stream = new MemoryStream();
|
||||
// workbook.Write(stream);
|
||||
// var buf = stream.ToArray();
|
||||
// FileInfo file = new FileInfo(filename);
|
||||
// //<2F><><EFBFBD><EFBFBD>ΪExcel<65>ļ<EFBFBD>
|
||||
// using (FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.Write))
|
||||
// {
|
||||
|
||||
// fs.Write(buf, 0, buf.Length);
|
||||
// fs.Flush();
|
||||
// }
|
||||
//}
|
||||
|
||||
//foreach (Autodesk.Revit.DB.View view in views)
|
||||
//{
|
||||
// //if (view.IsTemplate) continue;
|
||||
// if (view.ViewType == ViewType.ThreeD)
|
||||
// {
|
||||
// Transaction trans = new Transaction(famdoc, "Export Image");
|
||||
// trans.Start();
|
||||
// if (concol!=null)
|
||||
// {
|
||||
// famdoc.Delete(concol.ToElementIds());
|
||||
// }
|
||||
// var graphicDisplayOptions = view.get_Parameter(BuiltInParameter.MODEL_GRAPHICS_STYLE);
|
||||
// graphicDisplayOptions.Set(6);
|
||||
// trans.Commit();
|
||||
// ImageExportList.Add(view.Id);
|
||||
// }
|
||||
//}
|
||||
//string directroy = Path.GetDirectoryName(path) +"\\"+;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,5 @@
|
||||
Click="LoadFam_Click"
|
||||
Content="载入" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -39,7 +39,7 @@ public partial class RenameFamilyViewModel : ObservableObject
|
||||
private bool isRunning;
|
||||
|
||||
[ObservableProperty]
|
||||
private Dictionary<string, List<Family>> collection;
|
||||
public partial Dictionary<string, List<Family>> Collection { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int categoryCount;
|
||||
@@ -86,7 +86,7 @@ public partial class RenameFamilyViewModel : ObservableObject
|
||||
{
|
||||
get
|
||||
{
|
||||
var selected = RenameItems.Select(item => item.IsSelected).Distinct().ToList();
|
||||
var selected = RenameItems?.Select(item => item.IsSelected).Distinct().ToList();
|
||||
if (selected == null)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -76,7 +76,10 @@
|
||||
<TextBox materialDesign:HintAssist.Hint="过滤族类别" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<GroupBox Grid.Row="0" Grid.Column="1" Header="修改列表">
|
||||
<GroupBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Header="修改列表">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
@@ -110,7 +113,10 @@
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}" ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}">
|
||||
<DataGridCheckBoxColumn
|
||||
Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}"
|
||||
ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<Border Background="Transparent">
|
||||
<CheckBox Content="全选" IsChecked="{Binding DataContext.IsAllItemsSelected, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
||||
@@ -122,9 +128,18 @@
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.HeaderStyle>
|
||||
</DataGridCheckBoxColumn>
|
||||
<DataGridTextColumn Binding="{Binding CategoryName}" Header="族类别" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding OldFamilyName}" Header="族名称" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding NewFamilyName, UpdateSourceTrigger=PropertyChanged}" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" Header="新族名称" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding CategoryName}"
|
||||
Header="族类别"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding OldFamilyName}"
|
||||
Header="族名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding NewFamilyName, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||
Header="新族名称" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<CheckBox
|
||||
@@ -181,7 +196,7 @@
|
||||
<ComboBoxItem Content="CD(场布)" Tag="CD" />
|
||||
<b:Interaction.Triggers>
|
||||
<b:EventTrigger EventName="PreviewTextInput">
|
||||
<b:InvokeCommandAction Command="{Binding PreviewTextInputCommand}" PassEventArgsToCommand="True"/>
|
||||
<b:InvokeCommandAction Command="{Binding PreviewTextInputCommand}" PassEventArgsToCommand="True" />
|
||||
</b:EventTrigger>
|
||||
</b:Interaction.Triggers>
|
||||
</ComboBox>
|
||||
@@ -197,7 +212,10 @@
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>-->
|
||||
<TextBox x:Name="TbSuffix" materialDesign:HintAssist.Hint="后缀" IsEnabled="{Binding CanInput}">
|
||||
<TextBox
|
||||
x:Name="TbSuffix"
|
||||
materialDesign:HintAssist.Hint="后缀"
|
||||
IsEnabled="{Binding CanInput}">
|
||||
<TextBox.Text>
|
||||
<Binding Path="SuffixText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
@@ -210,7 +228,10 @@
|
||||
</GroupBox>
|
||||
<GroupBox Header="查找/替换">
|
||||
<StackPanel>
|
||||
<TextBox x:Name="TbFound" materialDesign:HintAssist.Hint="查找" IsEnabled="{Binding CanInput}">
|
||||
<TextBox
|
||||
x:Name="TbFound"
|
||||
materialDesign:HintAssist.Hint="查找"
|
||||
IsEnabled="{Binding CanInput}">
|
||||
<TextBox.Text>
|
||||
<Binding Path="FoundText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
@@ -219,7 +240,10 @@
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBox x:Name="TbReplace" materialDesign:HintAssist.Hint="替换" IsEnabled="{Binding CanInput}">
|
||||
<TextBox
|
||||
x:Name="TbReplace"
|
||||
materialDesign:HintAssist.Hint="替换"
|
||||
IsEnabled="{Binding CanInput}">
|
||||
<TextBox.Text>
|
||||
<Binding Path="ReplaceText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
|
||||
Reference in New Issue
Block a user