Msg.Se.Framework 1.0.0

dotnet add package Msg.Se.Framework --version 1.0.0
                    
NuGet\Install-Package Msg.Se.Framework -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Msg.Se.Framework" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Msg.Se.Framework" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Msg.Se.Framework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Msg.Se.Framework --version 1.0.0
                    
#r "nuget: Msg.Se.Framework, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Msg.Se.Framework@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Msg.Se.Framework&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Msg.Se.Framework&version=1.0.0
                    
Install as a Cake Tool

Msg.Se.Framework

这是一个用于快速开发 SolidEdge AddIn (插件) 的 .NET 框架。本框架通过约定优于配置(Convention over Configuration)和 XAML 声明式的 UI 设计,极大地简化了 SolidEdge Ribbon 界面和按钮命令的创建。

特性

  • 🚀 快速启动: 继承 SeAddInEx 即可完成生命周期和 COM 注册管理。
  • 🎨 XAML 声明式 UI: 使用熟悉的 XAML 语法直接生成 SolidEdge 的 Ribbon 界面(无需手写长篇大论的 API 创建按钮)。
  • ⚙️ 自动代码生成: 框架内置 Roslyn Generator 分析器,自动扫描命令处理程序并生成绑定代码。

📦 如何使用

1. 继承基础 AddIn 模块

创建一个主类继承自 SeAddInEx 并加上 GuidComVisible 等基础特性:

using System.Runtime.InteropServices;
using Msg.Se.Framework.Core;

namespace MySolidEdgeAddIn
{
    [Guid("YOUR-GUID-HERE")] // 请替换为您自己的 GUID
    [ComVisible(true)]
    [ProgId("MySolidEdgeAddIn.AddIn")]
    public class MyAddIn : SeAddInEx
    {
        // 框架会自动帮您处理 Connect/Disconnect,无需手写繁琐的 COM 接口
    }
}

2. 使用 XAML 创建您的 Ribbon 界面 (基础模板)

在您的项目中创建一个文件名为 RibbonUI.xaml 的文件(记得在属性里设置为 AdditionalFiles 或普通文件类型,以供解析),按照以下格式声明:

<se:Ribbon xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:se="clr-namespace:Msg.Se.Framework.AddInEx;assembly=Msg.Se.Framework"
           xmlns:cmd="clr-namespace:MySolidEdgeAddIn.Commands;assembly=MySolidEdgeAddIn">
    
    

    
    <se:Tab Name="MyAddInTab" Title="我的插件">
        
        
        <se:Group Name="Tools" Title="工具集" Style="IconAndCaptionBelow">
            
            <se:Button Name="HelloWorld" Title="Hello World" Handler="{x:Type cmd:HelloWorldCommand}" />
        </se:Group>

    </se:Tab>

</se:Ribbon>

3. 创建您的命令 (Command Handler)

创建上面绑定的 HelloWorldCommand,它需要继承您框架的命令基类(例如 SeCommand 或具体接口,根据框架实际定义):

namespace MySolidEdgeAddIn.Commands
{
    public class HelloWorldCommand : SeCommand // 继承框架的命令基类
    {
        public override void Execute()
        {
            // 在这里编写业务逻辑
            System.Windows.Forms.MessageBox.Show("Hello SolidEdge!");
        }
    }
}

享受开发 SolidEdge 插件的过程吧!

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Msg.Se.Framework:

Package Downloads
Msg.Se.Core

Core library for Msg.Se SolidEdge Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 86 5/31/2026