更新整理
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Windows;
|
||||
|
||||
using Nice3point.Revit.Toolkit.External.Handlers;
|
||||
|
||||
|
||||
using ShrlAlgo.RvKits.Properties;
|
||||
using ShrlAlgo.RvKits.RvView;
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvView;
|
||||
|
||||
namespace ShrlAlgo.RvKits.UIRibbon;
|
||||
namespace ShrlAlgoToolkit.RevitAddins.UIRibbon;
|
||||
|
||||
public class DrawingViewApp
|
||||
{
|
||||
private static readonly string TabName = Properties.Settings.Default.TabName;
|
||||
private static readonly string TabName = RevitAddins.Properties.Settings.Default.TabName;
|
||||
|
||||
public DrawingViewApp(UIControlledApplication application)
|
||||
{
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Windows;
|
||||
|
||||
using ShrlAlgo.RvKits.Properties;
|
||||
using ShrlAlgo.RvKits.RvFamily;
|
||||
using ShrlAlgo.RvKits.RvFamily.FamilyLibrary;
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvFamily;
|
||||
|
||||
namespace ShrlAlgo.RvKits.UIRibbon;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvFamily.FamilyLibrary;
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
|
||||
namespace ShrlAlgoToolkit.RevitAddins.UIRibbon;
|
||||
|
||||
public class FamilyApp
|
||||
{
|
||||
@@ -55,7 +56,7 @@ public class FamilyApp
|
||||
private const string VbRecentPanelName = "最近使用";
|
||||
|
||||
//获取Ribbon类所在的通用类库目录
|
||||
private static readonly string TabName = Properties.Settings.Default.TabName;
|
||||
private static readonly string TabName = RevitAddins.Properties.Settings.Default.TabName;
|
||||
private readonly UIApplication uiapp;
|
||||
|
||||
public ObservableCollection<FamilyModel> Items { get; set; }
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Controls;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using Autodesk.Windows;
|
||||
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
using Nice3point.Revit.Toolkit.External.Handlers;
|
||||
using ShrlAlgo.RvKits.RvCommon;
|
||||
using System.ComponentModel;
|
||||
using ShrlAlgoToolkit.Core.Assists;
|
||||
|
||||
using ShrlAlgoToolkit.RevitAddins.Assists;
|
||||
|
||||
using System.Windows.Controls;
|
||||
using ShrlAlgo.Toolkit.Core.Assist;
|
||||
using ShrlAlgoToolkit.Core.Assist;
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvCommon;
|
||||
|
||||
namespace ShrlAlgo.RvKits.UIRibbon;
|
||||
namespace ShrlAlgoToolkit.RevitAddins.UIRibbon;
|
||||
|
||||
public class ModifyTabApp
|
||||
{
|
||||
@@ -214,7 +211,7 @@ public class ModifyTabApp
|
||||
//面板按钮
|
||||
var alignLeftBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.align_left_16px.ToBitmapSource(),
|
||||
Image = Resources.align_left_16px.ToBitmapSource(),
|
||||
//LargeImage = Properties.Resources.align_left_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -229,7 +226,7 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignRightBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.align_right_16px.ToBitmapSource(),
|
||||
Image = Resources.align_right_16px.ToBitmapSource(),
|
||||
//LargeImage = Properties.Resources.align_right_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -245,7 +242,7 @@ public class ModifyTabApp
|
||||
|
||||
var alignDownBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.align_down_16px.ToBitmapSource(),
|
||||
Image = Resources.align_down_16px.ToBitmapSource(),
|
||||
//LargeImage = Properties.Resources.align_down_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -260,7 +257,7 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignUpBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.align_top_16px.ToBitmapSource(),
|
||||
Image = Resources.align_top_16px.ToBitmapSource(),
|
||||
//LargeImage = Properties.Resources.align_top_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -275,7 +272,7 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignHCBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.align_center_16px.ToBitmapSource(),
|
||||
Image = Resources.align_center_16px.ToBitmapSource(),
|
||||
//LargeImage = Properties.Resources.align_center_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -290,7 +287,7 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignVCBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.align_middle_16px.ToBitmapSource(),
|
||||
Image = Resources.align_middle_16px.ToBitmapSource(),
|
||||
//LargeImage = Properties.Resources.align_middle_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -305,8 +302,8 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignTopBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.top_elev_16px.ToBitmapSource(),
|
||||
LargeImage = Properties.Resources.top_elev_32px.ToBitmapSource(),
|
||||
Image = Resources.top_elev_16px.ToBitmapSource(),
|
||||
LargeImage = Resources.top_elev_32px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
ToolTip = "几何元素顶部高程对齐",
|
||||
@@ -321,8 +318,8 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignMiddleBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.middle_elev_16px.ToBitmapSource(),
|
||||
LargeImage = Properties.Resources.middle_elev_32px.ToBitmapSource(),
|
||||
Image = Resources.middle_elev_16px.ToBitmapSource(),
|
||||
LargeImage = Resources.middle_elev_32px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
ToolTip = "几何元素中心高程对齐",
|
||||
@@ -336,8 +333,8 @@ public class ModifyTabApp
|
||||
};
|
||||
var alignBottomBtn = new Autodesk.Windows.RibbonButton
|
||||
{
|
||||
Image = Properties.Resources.bottom_elev_16px.ToBitmapSource(),
|
||||
LargeImage = Properties.Resources.bottom_elev_32px.ToBitmapSource(),
|
||||
Image = Resources.bottom_elev_16px.ToBitmapSource(),
|
||||
LargeImage = Resources.bottom_elev_32px.ToBitmapSource(),
|
||||
//Standard为16px,Large为32px
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
@@ -393,7 +390,7 @@ public class ModifyTabApp
|
||||
new()
|
||||
{
|
||||
//Image = new System.Windows.Media.Imaging.BitmapImage(new Uri(icopath)),
|
||||
Image = Properties.Resources.select_on_view_16px.ToBitmapSource(),
|
||||
Image = Resources.select_on_view_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
Id = "ID_IAV_BTN",
|
||||
@@ -437,7 +434,7 @@ public class ModifyTabApp
|
||||
Autodesk.Windows.RibbonButton iipBtn =
|
||||
new()
|
||||
{
|
||||
Image = Properties.Resources.select_on_project_16px.ToBitmapSource(),
|
||||
Image = Resources.select_on_project_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
Id = "ID_IIP_BTN",
|
||||
@@ -480,7 +477,7 @@ public class ModifyTabApp
|
||||
Autodesk.Windows.RibbonButton rSelBtn =
|
||||
new()
|
||||
{
|
||||
Image = Properties.Resources.select_3d_object_16px.ToBitmapSource(),
|
||||
Image = Resources.select_3d_object_16px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Standard,
|
||||
ShowText = true,
|
||||
Id = "ID_BS_BTN",
|
||||
@@ -533,8 +530,8 @@ public class ModifyTabApp
|
||||
new()
|
||||
{
|
||||
//Image = new System.Windows.Media.Imaging.BitmapImage(new Uri(icopath)),
|
||||
Image = Properties.Resources.select_filter_16px.ToBitmapSource(),
|
||||
LargeImage = Properties.Resources.select_filter_32px.ToBitmapSource(),
|
||||
Image = Resources.select_filter_16px.ToBitmapSource(),
|
||||
LargeImage = Resources.select_filter_32px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Large,
|
||||
ShowText = true,
|
||||
Id = "ID_Filter_BTN",
|
||||
@@ -586,8 +583,8 @@ public class ModifyTabApp
|
||||
new()
|
||||
{
|
||||
//Image = new System.Windows.Media.Imaging.BitmapImage(new Uri(icopath)),
|
||||
Image = Properties.Resources.select_filter_16px.ToBitmapSource(),
|
||||
LargeImage = Properties.Resources.select_filter_32px.ToBitmapSource(),
|
||||
Image = Resources.select_filter_16px.ToBitmapSource(),
|
||||
LargeImage = Resources.select_filter_32px.ToBitmapSource(),
|
||||
Size = RibbonItemSize.Large,
|
||||
ShowText = true,
|
||||
Id = "ID_Filter_BTN",
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using Nice3point.Revit.Toolkit.External;
|
||||
using Nice3point.Revit.Toolkit.External.Handlers;
|
||||
|
||||
using ShrlAlgoToolkit.RevitAddins.ModelManager;
|
||||
|
||||
using ShrlAlgo.RvKits.ModelManager;
|
||||
using ShrlAlgo.RvKits.Properties;
|
||||
using ShrlAlgo.RvKits.RvCivil;
|
||||
using ShrlAlgo.RvKits.RvCommon;
|
||||
using ShrlAlgo.RvKits.RvFamily;
|
||||
using ShrlAlgo.RvKits.RvIndependent;
|
||||
using ShrlAlgo.RvKits.RvIndependent.MetroGauges;
|
||||
using ShrlAlgo.RvKits.RvIndependent.MetroTunnel;
|
||||
using ShrlAlgo.RvKits.RvIndependent.NetworkCreator;
|
||||
using ShrlAlgo.RvKits.RvMEP;
|
||||
using ShrlAlgo.RvKits.RvView;
|
||||
|
||||
namespace ShrlAlgo.RvKits.UIRibbon;
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvCivil;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvCommon;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvIndependent.MetroGauges;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvIndependent.MetroTunnel;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvIndependent.NetworkCreator;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvMEP;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvView;
|
||||
|
||||
using System.Windows;
|
||||
|
||||
namespace ShrlAlgoToolkit.RevitAddins.UIRibbon;
|
||||
|
||||
public class RvApp : ExternalApplication
|
||||
{
|
||||
@@ -92,9 +91,9 @@ public class RvApp : ExternalApplication
|
||||
_ = new TabManagerApp(Application);
|
||||
_ = new FamilyApp(Application, UiApplication);
|
||||
|
||||
if (Properties.Settings.Default.IsActiveAutoSave)
|
||||
if (RevitAddins.Properties.Settings.Default.IsActiveAutoSave)
|
||||
{
|
||||
var interval = Properties.Settings.Default.AutoSaveIntervalTime * 60_000;
|
||||
var interval = RevitAddins.Properties.Settings.Default.AutoSaveIntervalTime * 60_000;
|
||||
saveTimer.Interval = interval;
|
||||
saveTimer.Elapsed -= OnTimedEvent;
|
||||
saveTimer.Elapsed += OnTimedEvent;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Windows;
|
||||
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
|
||||
namespace ShrlAlgo.RvKits.UIRibbon;
|
||||
namespace ShrlAlgoToolkit.RevitAddins.UIRibbon;
|
||||
|
||||
public class TabManagerApp
|
||||
{
|
||||
public TabManagerApp(UIControlledApplication application)
|
||||
{
|
||||
var tab = RibbonControl.Tabs.First(t => t.Name == Properties.Settings.Default.TabName);
|
||||
var tab = RibbonControl.Tabs.First(t => t.Name == RevitAddins.Properties.Settings.Default.TabName);
|
||||
|
||||
SetTabControl(tab);
|
||||
application.ViewActivating += Application_ViewActivating;
|
||||
@@ -20,7 +21,7 @@ public class TabManagerApp
|
||||
|
||||
private void InsertQuickAccessAndHidePanel()
|
||||
{
|
||||
var tab = RibbonControl.FindTab(Properties.Settings.Default.TabName);
|
||||
var tab = RibbonControl.FindTab(RevitAddins.Properties.Settings.Default.TabName);
|
||||
|
||||
if (tab != null && addInManagerPanel != null)
|
||||
{
|
||||
@@ -46,8 +47,8 @@ public class TabManagerApp
|
||||
Text = "插件管理",
|
||||
Name = "插件管理",
|
||||
Description = "控制插件在Revit界面上的显示",
|
||||
Image = Properties.Resources.addin_16px.ToBitmapSource(),
|
||||
LargeImage = Properties.Resources.addin_32px.ToBitmapSource(),
|
||||
Image = Resources.addin_16px.ToBitmapSource(),
|
||||
LargeImage = Resources.addin_32px.ToBitmapSource(),
|
||||
ShowText = true,
|
||||
ShowImage = true,
|
||||
ToolTip = "控制插件在Revit界面上的显示",
|
||||
@@ -63,7 +64,7 @@ public class TabManagerApp
|
||||
var ribbon = ComponentManager.Ribbon;
|
||||
foreach (var tab in ribbon.Tabs)
|
||||
{
|
||||
if (tab.GetType() == typeof(RibbonTab) && tab.Title != Properties.Settings.Default.TabName)
|
||||
if (tab.GetType() == typeof(RibbonTab) && tab.Title != RevitAddins.Properties.Settings.Default.TabName)
|
||||
{
|
||||
RibbonToggleButton ribbonToggleButton =
|
||||
new()
|
||||
@@ -132,7 +133,7 @@ public class TabManagerApp
|
||||
//如果是族文档,在激活视图时,隐藏面板
|
||||
private void Application_ViewActivating(object sender, Autodesk.Revit.UI.Events.ViewActivatingEventArgs e)
|
||||
{
|
||||
SetTabEnabled(Properties.Settings.Default.TabName, !e.NewActiveView.Document.IsFamilyDocument);
|
||||
SetTabEnabled(RevitAddins.Properties.Settings.Default.TabName, !e.NewActiveView.Document.IsFamilyDocument);
|
||||
}
|
||||
|
||||
private void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user