From 1699b69ebcdb781dafa53b6b47262778fa08bdba Mon Sep 17 00:00:00 2001 From: "Blank.li" Date: Fri, 24 Oct 2025 10:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1=E7=AA=97?= =?UTF-8?q?=E6=A0=BC=E5=92=8C=E7=AA=97=E5=8F=A3=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 `AddinEntry.cs` 中添加了 `FeaturesUserControl` 任务窗格,设置了标题和工具提示。更新了 `SWDocReader.cs`,移除调试输出并添加条件判断。修改 `Laservall.Solidworks.csproj` 以支持 WPF 项目类型,添加了新的编译项和 XAML 页面。在 `FeaturesUserControl.xaml` 和 `FeaturesUserControl.xaml.cs` 中创建了用户控件和按钮事件处理。在 `ItemsPropWindow.xaml` 和 `ItemsPropWindow.xaml.cs` 中创建了新窗口和数据模板。 --- AddinEntry.cs | 6 ++++ Extension/SWDocReader.cs | 4 +-- Laservall.Solidworks.csproj | 16 +++++++++++ Pane/FeaturesUserControl.xaml | 15 ++++++++++ Pane/FeaturesUserControl.xaml.cs | 34 +++++++++++++++++++++++ Windows/ItemsPropWindow.xaml | 47 ++++++++++++++++++++++++++++++++ Windows/ItemsPropWindow.xaml.cs | 41 ++++++++++++++++++++++++++++ 7 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 Pane/FeaturesUserControl.xaml create mode 100644 Pane/FeaturesUserControl.xaml.cs create mode 100644 Windows/ItemsPropWindow.xaml create mode 100644 Windows/ItemsPropWindow.xaml.cs diff --git a/AddinEntry.cs b/AddinEntry.cs index 907e74c..1871b30 100644 --- a/AddinEntry.cs +++ b/AddinEntry.cs @@ -48,6 +48,12 @@ namespace Laservall.Solidworks { SubscribeToSelectionEvents(this.Application.Documents.Active); } + + this.CreateTaskPane(new TaskPaneSpec + { + Title = "Laservall Features", + Tooltip = "Laservall Features" + }); } private void OnDocumentActivated(IXDocument doc) { diff --git a/Extension/SWDocReader.cs b/Extension/SWDocReader.cs index 57b1881..64dbfc8 100644 --- a/Extension/SWDocReader.cs +++ b/Extension/SWDocReader.cs @@ -94,9 +94,7 @@ namespace Laservall.Solidworks.Extension swCustProp = swModelDocExt.get_CustomPropertyManager(""); //status = swCustProp.Get4(propertyName, false, out val, out valout); status = swCustProp.Get6(propertyName, false, out val,out valout,out bool wasResolved,out bool _); - Debug.Print("Value: " + val); - Debug.Print("Evaluated value: " + valout); - //Debug.Print("Up-to-date data: " + status); + if (wasResolved) { return valout; diff --git a/Laservall.Solidworks.csproj b/Laservall.Solidworks.csproj index e3e2a1a..0d34cb9 100644 --- a/Laservall.Solidworks.csproj +++ b/Laservall.Solidworks.csproj @@ -5,6 +5,7 @@ Debug AnyCPU {A8B83CC2-1DC4-478D-8956-B5357CDC336A} + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Properties Laservall.Solidworks @@ -80,6 +81,9 @@ + + FeaturesUserControl.xaml + PartPropPaneUserControl.xaml @@ -87,11 +91,18 @@ TestUserControl.xaml + + ItemsPropWindow.xaml + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -103,7 +114,12 @@ MSBuild:Compile + + Designer + MSBuild:Compile + + diff --git a/Pane/FeaturesUserControl.xaml b/Pane/FeaturesUserControl.xaml new file mode 100644 index 0000000..5710d35 --- /dev/null +++ b/Pane/FeaturesUserControl.xaml @@ -0,0 +1,15 @@ + + + +