命名优化,达芬奇字体修改工具
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Szmedi.RvKits.Civil
|
||||
//StringBuilder sb = new StringBuilder();
|
||||
|
||||
Document.Invoke(
|
||||
ts =>
|
||||
_ =>
|
||||
{
|
||||
foreach (var instance in solidInstances)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ExplodeDwgCmd : IExternalCommand
|
||||
var geoElem = element.get_Geometry(new Options() { ComputeReferences = true, DetailLevel = ViewDetailLevel.Fine });
|
||||
var f = Document.OwnerFamily;
|
||||
Document.Invoke(
|
||||
ts =>
|
||||
_ =>
|
||||
{
|
||||
foreach (var geoObj in geoElem)
|
||||
{
|
||||
|
||||
@@ -28,13 +28,13 @@ public partial class FamilyLibraryViewModel : ObservableObject
|
||||
loadFamilyHandler = new ActionEventHandler();
|
||||
loadFamilySymbolHandler = new ActionEventHandler();
|
||||
#if REVIT2018
|
||||
familyPath = Settings.Default.FamilyPath_2018;
|
||||
FamilyPath = Settings.Default.FamilyPath_2018;
|
||||
#elif REVIT2019
|
||||
familyPath = Settings.Default.FamilyPath_2019;
|
||||
FamilyPath = Settings.Default.FamilyPath_2019;
|
||||
#elif REVIT2020
|
||||
familyPath = Settings.Default.FamilyPath_2020;
|
||||
FamilyPath = Settings.Default.FamilyPath_2020;
|
||||
#elif REVIT2021
|
||||
familyPath = Settings.Default.FamilyPath_2021;
|
||||
FamilyPath = Settings.Default.FamilyPath_2021;
|
||||
#endif
|
||||
PageSize = 20;
|
||||
Initialize();
|
||||
@@ -44,34 +44,34 @@ public partial class FamilyLibraryViewModel : ObservableObject
|
||||
private readonly ActionEventHandler loadFamilySymbolHandler;
|
||||
|
||||
[ObservableProperty]
|
||||
private string familyPath;
|
||||
public partial string FamilyPath { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int pageCount;
|
||||
public partial int PageCount { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int pageSize;
|
||||
public partial int PageSize { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string revitVersion;
|
||||
public partial string RevitVersion { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private FamilyModel selectedFamily;
|
||||
public partial FamilyModel SelectedFamily { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private FamilyTypeDefinition selectedSymbolType;
|
||||
public partial FamilyTypeDefinition SelectedSymbolType { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private List<FamilyTypeDefinition> symbolTypes;
|
||||
public partial List<FamilyTypeDefinition> SymbolTypes { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool activeSnackbar;
|
||||
public partial bool ActiveSnackbar { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private NeoUI.Controls.Alert messageQueue = new();
|
||||
public partial NeoUI.Controls.Alert MessageQueue { get; set; } = new();
|
||||
|
||||
[ObservableProperty]
|
||||
private string message;
|
||||
public partial string Message { get; set; }
|
||||
|
||||
partial void OnMessageChanged(string value)
|
||||
{
|
||||
|
||||
@@ -19,45 +19,47 @@ namespace ShrlAlgoToolkit.RevitAddins.RvFamily;
|
||||
public partial class FamilyProcessorViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool addCategoryPrefix;
|
||||
public partial bool AddCategoryPrefix { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool createCategoryFolder;
|
||||
public partial bool CreateCategoryFolder { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private IList<ElementType> familyEditCollection;
|
||||
public partial IList<ElementType> FamilyEditCollection { get; set; }
|
||||
|
||||
//private readonly List<TreeModel> familyNodes = new();
|
||||
|
||||
[ObservableProperty]
|
||||
private string findStr;
|
||||
public partial string FindStr { get; set; }
|
||||
|
||||
private readonly ActionEventHandler handler;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isOverride = true;
|
||||
public partial bool IsOverride { get; set; } = true;
|
||||
|
||||
[ObservableProperty]
|
||||
private int modifyNameIndex;
|
||||
public partial int ModifyNameIndex { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvFamily.FamilyProcessorViewModel.SaveFamiliesCommand))]
|
||||
private string pathToSaveFamily;
|
||||
public partial string PathToSaveFamily { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string prefix;
|
||||
public partial string Prefix { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string replaceStr;
|
||||
public partial string ReplaceStr { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvFamily.FamilyProcessorViewModel.TransmitFamilyCommand), nameof(RevitAddins.RvFamily.FamilyProcessorViewModel.SaveFamiliesCommand))]
|
||||
private Document sourceDoc;
|
||||
public partial Document SourceDoc { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string suffix;
|
||||
public partial string Suffix { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvFamily.FamilyProcessorViewModel.TransmitFamilyCommand))]
|
||||
private Document targetDoc;
|
||||
public partial Document TargetDoc { get; set; }
|
||||
|
||||
//private readonly ExternalEvent saveEvent;
|
||||
//private readonly SaveFamilyHandler handler;
|
||||
@@ -67,9 +69,11 @@ public partial class FamilyProcessorViewModel : ObservableObject
|
||||
private readonly UIApplication uiapp;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool view3dAsDefault;
|
||||
public partial bool View3dAsDefault { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public List<Family> familyCollection = new();
|
||||
public partial List<Family> FamilyCollection { get; set; } = new();
|
||||
|
||||
[ObservableProperty]
|
||||
public List<Document> sourceDocsList;
|
||||
|
||||
|
||||
@@ -7,15 +7,15 @@ namespace ShrlAlgoToolkit.RevitAddins.RvFamily;
|
||||
public partial class RenameFamilyItem : ObservableValidator
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool isSelected;
|
||||
public partial bool IsSelected { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[UndefinedChar]
|
||||
[NotifyDataErrorInfo]
|
||||
private string newFamilyName;
|
||||
public partial string NewFamilyName { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string oldFamilyName;
|
||||
public partial string OldFamilyName { get; set; }
|
||||
|
||||
partial void OnIsSelectedChanged(bool value)
|
||||
{
|
||||
|
||||
@@ -29,43 +29,44 @@ public partial class RenameFamilyViewModel : ObservableObject
|
||||
private readonly Document doc;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool canInput;
|
||||
public partial bool CanInput { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isRunning;
|
||||
public partial bool IsRunning { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isUsed;
|
||||
public partial bool IsUsed { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private Dictionary<string, List<Family>> collection;
|
||||
public partial Dictionary<string, List<Family>> Collection { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int categoryCount;
|
||||
public partial int CategoryCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表中元素
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvFamily.RenameFamilyViewModel.ModifyNameCommand))]
|
||||
private List<RenameFamilyItem> renameItems;
|
||||
public partial List<RenameFamilyItem> RenameItems { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string foundText;
|
||||
public partial string FoundText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string prefixText;
|
||||
public partial string PrefixText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string replaceText;
|
||||
public partial string ReplaceText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string searchText;
|
||||
public partial string SearchText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string separator = "-";
|
||||
public partial string Separator { get; set; } = "-";
|
||||
|
||||
[ObservableProperty]
|
||||
private string suffixText;
|
||||
public partial string SuffixText { get; set; }
|
||||
|
||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
|
||||
public bool CanModify => RenameItems?.Any(item => item.IsSelected) == true;
|
||||
@@ -231,7 +232,7 @@ public partial class RenameFamilyViewModel : ObservableObject
|
||||
//IsAllItemsSelected = true;
|
||||
foreach (var renameItem in RenameItems)
|
||||
{
|
||||
renameItem.PropertyChanged += (sender, args) =>
|
||||
renameItem.PropertyChanged += (_, args) =>
|
||||
{
|
||||
//选中属性修改时,触发
|
||||
if (args.PropertyName == nameof(RevitAddins.RvFamily.RenameFamilyItem.IsSelected))
|
||||
|
||||
@@ -7,15 +7,15 @@ namespace ShrlAlgoToolkit.RevitAddins.RvFamily;
|
||||
public partial class RenameTypeItem : ObservableValidator
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool isSelected;
|
||||
public partial bool IsSelected { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[UndefinedChar]
|
||||
[NotifyDataErrorInfo]
|
||||
private string newTypeName;
|
||||
public partial string NewTypeName { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string oldTypeName;
|
||||
public partial string OldTypeName { get; set; }
|
||||
|
||||
partial void OnIsSelectedChanged(bool value)
|
||||
{
|
||||
|
||||
@@ -30,52 +30,51 @@ public partial class RenameTypeViewModel : ObservableObject
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvFamily.RenameTypeViewModel.ModifyNameCommand))]
|
||||
//[NotifyPropertyChangedFor(nameof(IsAllItemsSelected))]
|
||||
private List<RenameTypeItem> renameItems;
|
||||
public partial List<RenameTypeItem> RenameItems { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool canInput;
|
||||
public partial bool CanInput { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isRunning;
|
||||
public partial bool IsRunning { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 选中正在使用中的条目
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool isUsed;
|
||||
public partial bool IsUsed { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private Dictionary<string, List<ElementType>> collection;
|
||||
public partial Dictionary<string, List<ElementType>> Collection { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int categoryCount;
|
||||
public partial int CategoryCount { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int modifyType;
|
||||
public partial int ModifyType { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string foundText;
|
||||
public partial string FoundText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string prefixText;
|
||||
public partial string PrefixText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string replaceText;
|
||||
public partial string ReplaceText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string searchText;
|
||||
public partial string SearchText { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string separator = "-";
|
||||
public partial string Separator { get; set; } = "-";
|
||||
|
||||
[ObservableProperty]
|
||||
private string suffixText;
|
||||
public partial string SuffixText { get; set; }
|
||||
|
||||
//[ObservableProperty]
|
||||
//private IList selectedItems;
|
||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
|
||||
public bool CanModify => RenameItems != null && Enumerable.Any<RenameTypeItem>(RenameItems, item => item.IsSelected);
|
||||
public bool CanModify => RenameItems != null && RenameItems.Any<RenameTypeItem>(item => item.IsSelected);
|
||||
//[ObservableProperty]
|
||||
//private bool? isAllItemsSelected;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user