命名优化,达芬奇字体修改工具
This commit is contained in:
@@ -13,7 +13,7 @@ public partial class AutoSaveViewModel : ObservableValidator
|
||||
IntervalTime = RevitAddins.Properties.Settings.Default.AutoSaveIntervalTime;
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool isActiveAutoSave;
|
||||
public partial bool IsActiveAutoSave { get; set; }
|
||||
|
||||
//partial void OnIsActiveAutoSaveChanged(bool value)
|
||||
//{
|
||||
@@ -21,12 +21,11 @@ public partial class AutoSaveViewModel : ObservableValidator
|
||||
//}
|
||||
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[DefaultValue(10)]
|
||||
[field: DefaultValue(10)]
|
||||
[NotifyDataErrorInfo]
|
||||
[Range(1, 30, ErrorMessage = "输入值应在1~30分钟之间")]
|
||||
[ObservableProperty]
|
||||
private int intervalTime;
|
||||
|
||||
public partial int IntervalTime { get; set; }
|
||||
|
||||
[RelayCommand]
|
||||
private void Closing()
|
||||
|
||||
@@ -16,15 +16,17 @@ namespace ShrlAlgoToolkit.RevitAddins.RvCommon
|
||||
private readonly ActionEventHandler handler;
|
||||
|
||||
[ObservableProperty]
|
||||
ICollectionView filteredList;
|
||||
public partial ICollectionView FilteredList { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isCutting;
|
||||
public partial bool IsCutting { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<SelectionElement> items;
|
||||
public partial ObservableCollection<SelectionElement> Items { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string searchProp;
|
||||
public partial string SearchProp { get; set; }
|
||||
|
||||
private readonly UIApplication uiapp;
|
||||
|
||||
public DetailSelectFiltersViewModel(UIApplication uiapp, ActionEventHandler handler)
|
||||
|
||||
@@ -89,19 +89,19 @@ public partial class InstanceCreatorViewModel : ObservableObject
|
||||
private readonly ActionEventHandler handler = new();
|
||||
|
||||
[ObservableProperty]
|
||||
private BitmapSource image;
|
||||
public partial BitmapSource Image { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.InstanceCreatorViewModel.PlaceInstancesCommand))]
|
||||
private bool canPlaceInstance = true;
|
||||
public partial bool CanPlaceInstance { get; set; } = true;
|
||||
|
||||
private readonly Document document;
|
||||
|
||||
[ObservableProperty]
|
||||
private double offset;
|
||||
public partial double Offset { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private Family selectedFamily;
|
||||
public partial Family SelectedFamily { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.InstanceCreatorViewModel.PlaceInstancesCommand))]
|
||||
|
||||
@@ -19,79 +19,80 @@ namespace ShrlAlgoToolkit.RevitAddins.RvCommon
|
||||
public partial class ModelByCurveCreatorViewModel : ObservableValidator
|
||||
{
|
||||
[ObservableProperty]
|
||||
private CenterCurveType centerCurveType;
|
||||
public partial CenterCurveType CenterCurveType { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private List<FamilySymbol> familyTypes;
|
||||
public partial List<FamilySymbol> FamilyTypes { get; set; }
|
||||
|
||||
private readonly ActionEventHandler handler;
|
||||
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[IsNumeric]
|
||||
[ObservableProperty]
|
||||
private double instanceOffsetX = 0;
|
||||
public partial double InstanceOffsetX { get; set; } = 0;
|
||||
|
||||
[ObservableProperty]
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[IsNumeric]
|
||||
private double instanceOffsetY = 0;
|
||||
public partial double InstanceOffsetY { get; set; } = 0;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.ModelByCurveCreatorViewModel.CreateTrackCommand))]
|
||||
private bool isRunning;
|
||||
public partial bool IsRunning { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isTwoSides = false;
|
||||
public partial bool IsTwoSides { get; set; } = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private List<Material> materials;
|
||||
public partial List<Material> Materials { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[IsNumeric]
|
||||
[ObservableProperty]
|
||||
private double offsetX = 0;
|
||||
public partial double OffsetX { get; set; } = 0;
|
||||
|
||||
[ObservableProperty]
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[IsNumeric]
|
||||
private double offsetY = 0;
|
||||
public partial double OffsetY { get; set; } = 0;
|
||||
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[IsNumeric]
|
||||
[Minimum(0.5)]
|
||||
[ObservableProperty]
|
||||
[NotifyDataErrorInfo]
|
||||
private double precision = 1.0;
|
||||
public partial double Precision { get; set; } = 1.0;
|
||||
|
||||
//private List<ElementId> previewIds = [];
|
||||
[ObservableProperty]
|
||||
private List<FamilySymbol> profileFamilyTypes;
|
||||
public partial List<FamilySymbol> ProfileFamilyTypes { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.ModelByCurveCreatorViewModel.CreateTrackCommand))]
|
||||
private FamilySymbol selectedFamilyType;
|
||||
public partial FamilySymbol SelectedFamilyType { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private Material selectedMaterial;
|
||||
public partial Material SelectedMaterial { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.ModelByCurveCreatorViewModel.CreateTrackCommand))]
|
||||
private FamilySymbol selectedProfileFamilyType;
|
||||
public partial FamilySymbol SelectedProfileFamilyType { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "不可为空")]
|
||||
[IsNumeric]
|
||||
[Minimum(100)]
|
||||
[NotifyDataErrorInfo]
|
||||
[ObservableProperty]
|
||||
private double spacing = 100;
|
||||
public partial double Spacing { get; set; } = 100;
|
||||
|
||||
public ModelByCurveCreatorViewModel(Document doc)
|
||||
{
|
||||
handler = new();
|
||||
profileFamilyTypes = [.. doc.OfClass<FamilySymbol>()
|
||||
ProfileFamilyTypes = [.. doc.OfClass<FamilySymbol>()
|
||||
.OfCategory(BuiltInCategory.OST_ProfileFamilies)
|
||||
.Cast<FamilySymbol>()
|
||||
.OrderBy(n => n.FamilyName)];
|
||||
familyTypes = [.. doc.OfClass<FamilySymbol>()
|
||||
FamilyTypes = [.. doc.OfClass<FamilySymbol>()
|
||||
.OfType<FamilySymbol>()
|
||||
.Where(
|
||||
s =>
|
||||
@@ -101,7 +102,7 @@ namespace ShrlAlgoToolkit.RevitAddins.RvCommon
|
||||
&& s.Family.FamilyPlacementType == FamilyPlacementType.OneLevelBased
|
||||
)
|
||||
.OrderBy(n => n.FamilyName)];
|
||||
materials = doc.OfClass<Material>().OrderBy(n => n.Name).OfType<Material>().ToList();
|
||||
Materials = doc.OfClass<Material>().OrderBy(n => n.Name).OfType<Material>().ToList();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
||||
@@ -25,11 +25,11 @@ public partial class PipesCreatorViewModel : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.PipesCreatorViewModel.CreateCommand))]
|
||||
private PipeType selectedPipeType;
|
||||
public partial PipeType SelectedPipeType { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(RevitAddins.RvCommon.PipesCreatorViewModel.CreateCommand))]
|
||||
private PipingSystemType selectedPipingSystemType;
|
||||
public partial PipingSystemType SelectedPipingSystemType { get; set; }
|
||||
|
||||
public IList<PipeType> PipeTypes => document.OfClass<PipeType>().Cast<PipeType>().ToList();
|
||||
public IList<PipingSystemType> PipingSystemTypes => document.OfClass<PipingSystemType>().Cast<PipingSystemType>().ToList();
|
||||
|
||||
@@ -19,7 +19,7 @@ public class PlaceInstanceByCircleCmd : ExternalCommand
|
||||
{
|
||||
var refer = UiDocument.Selection.PickObject(ObjectType.Element, "请选择一个实例");
|
||||
var familyInstance = Document.GetElement(refer) as FamilyInstance;
|
||||
var dwgRefer = UiDocument.Selection.PickObject(ObjectType.PointOnElement, new FuncFilter(e => e.Document.GetElement(e.GetTypeId()) is CADLinkType, (r, p) => r.ElementReferenceType == ElementReferenceType.REFERENCE_TYPE_LINEAR), "请拾取dwg链接的圆弧获取图层创建");
|
||||
var dwgRefer = UiDocument.Selection.PickObject(ObjectType.PointOnElement, new FuncFilter(e => e.Document.GetElement(e.GetTypeId()) is CADLinkType, (r, _) => r.ElementReferenceType == ElementReferenceType.REFERENCE_TYPE_LINEAR), "请拾取dwg链接的圆弧获取图层创建");
|
||||
Element elem = Document.GetElement(dwgRefer);
|
||||
GeometryElement geoElem = elem.get_Geometry(new Options());
|
||||
GeometryObject geoObj = elem.GetGeometryObjectFromReference(dwgRefer);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SplitImportInstanceCmd : ExternalCommand
|
||||
},
|
||||
"拆分实体");
|
||||
}
|
||||
catch (Autodesk.Revit.Exceptions.OperationCanceledException ex)
|
||||
catch (Autodesk.Revit.Exceptions.OperationCanceledException)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user