首页 > 其他分享 >Sold Edge 插件 注册

Sold Edge 插件 注册

时间:2022-12-02 20:33:06浏览次数:60  
标签:插件 exe addin Solid Sold will Edge your

Solid Edge AddIn Demo

 

NuGet

This project makes use of the SolidEdge.Community open source project on GitHub. The SolidEdge.Community project is published via NuGet with the package ID of SolidEdge.Community. Please refer to the SolidEdge.Community readme for more details.

 


 

Registration

Registering your addin has never been easier due to the SolidEdge.Community provided Package Manager Console Commands. In Visual Studio 2012\2013, navigate to Tools -> NuGet Package Manager -> Package Manager Console. Type Register-SolidEdgeAddIn and hit enter. This command will execute the x86 & x64 version of regasm.exe against your assembly.

 

When regasm.exe is executed against the assembly, the OnRegister method will get called. This is where you can control the registration process of your addin.

 


 

Unregistration

Unregistering the addin is just as easy. In Visual Studio 2012\2013, navigate to Tools -> NuGet Package Manager -> Package Manager Console. Type Unregister-SolidEdgeAddIn and hit enter. This command will execute the x86 & x64 version of regasm.exe /u against your assembly.

 

When regasm.exe /u is executed against the assembly, the OnUnregister method will get called. This is where you can control the unregistration process of your addin.

 


 

Native Win32 Resources

Embedding native Win32 resources for your EdgeBar and Ribbon is made possible by the SolidEdge.Community package. Add your BMP\PNG resources to a folder under the project directory and modify the AssemblyInfo.(cs|vb) with the NativeResource attribute as shown below.

 

When you build your solution, the images will be automatically embedded as native Win32 resources.

You can open your .dll in Visual Studio, Resource Hacker, etc. to verify that the resources got embedded during the post build event. If you do open your .dll in this manner, be sure to close it before attempting another build or you will get a build error due to the file being in use.

 


 

Ribbons

Before creating your own ribbon XML, you’ll want to execute the Install-SolidEdgeAddInRibbonSchema command. This command adds a Ribbon.xsd that enables intellisense when editing the ribbon XML.

 

You can now completely define your Ribbon in XML as shown below. The imageId attribute for each control points to a NativeResource that you previously defined in AssemblyInfo.(cs|vb).

 

The OnCreateRibbon method of your addin will get called when it’s time to create the Ribbon.

 

In the following example, an instance of our PartRibbon class get created. In the constructor, we load the Ribbon XML to configure the ribbon.

 


 

EdgeBar

The SolidEdgeCommunity.AddIn.EdgeBarControl class provides the base functionality to create an EdgeBar control. Simply add a new “User Control” to your project and change the base class from UserControl to  SolidEdgeCommunity.AddIn.EdgeBarControl.

 

When it’s time to add your control to the EdgeBar, the addin framework will call OnCreateEdgeBarPage.

 


 

AppDomains

One of the challenges of developing .NET Solid Edge AddIns in the past was the fact that every addin got loaded into the “DefaultDomain (AppDomain)”. This meant that every .NET addin shared the same runtime callable wrappers (RCW). If there are multiple .NET addins installed on the machine, the risk of a single addin causing problems for the other addins greatly increases.

The SolidEdgeCommunity.AddIn.SolidEdgeAddIn base class (mostly) fixes this issue by creating an isolated AppDomain for your addin to execute. Due to the current architecture of Solid Edge addins, we cannot avoid the fact that our addin will get loaded into the “DefaultDomain” but if you inherit from SolidEdgeCommunity.AddIn.SolidEdgeAddIn, you minimize the possibility of your addin being affected by other .NET addins.

The following screenshot is from Process Explorer. The current url is http://technet.microsoft.com/sysinternals/bb896653.aspx but may change.


Deployment (manual)

There are various method to deploying a Solid Edge AddIn. In its simplest form, you simply copy the required files to the target machine and execute RegAsm.exe on the addin.dll. RegAsm.exe does nothing more than write required registry entries that allow Solid Edge to see and load the addin.dll.

  • Copy AddInDemo.dll & SolidEdge.Community.dll to target machine (same folder).
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase [path_to_addin.dll]
    • On an x64 machine, registers for Solid Edge x64.
    • On an x86 machine, registers for Solid Edge x86.
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe /codebase [path_to_addin.dll]
    • On an X64 machine, registers for Solid Edge x86.

The following screenshot demonstrates how to view the registry entries. You can search by your addin guid. In this case, BF1C1BB8-75EE-444A-8DCE-0F1521D0764B.

 

Figure 1 - Windows x64 - Solid Edge x64

 

Figure 2 - Windows x64 - Solid Edge x86


 

Deployment (installer)

There are various installer products available so it’s not realistic to cover them all. The general concept is basically the same as the manual approach. Most modern installers offer you the ability to record and embed the registry entries so that calling RegAsm.exe is not necessary. In most cases, that is a desirable feature and the recommended approach if available.

标签:插件,exe,addin,Solid,Sold,will,Edge,your
From: https://www.cnblogs.com/PLM-Teamcenter/p/16945549.html

相关文章

  • Deepin系统安装eclipse、subversion插件、IDEA安装
    eclipse、IDEA安装直接deepin商店直接安装的1.eclipsesubversion插件安装eclipsesubversion插件CSDN都要收费,找了很久才找到不收费的。感谢~下载下载后解压打开......
  • Deepin系统安装Java、maven、svn、git、eclipse svn插件、docker
    目录jdk、Maven安装svn、git安装eclipse、IDEA安装docker安装jdk、Maven安装下载jdk、Mavenjdk下载地址|maven下载安装配置对下载好的jdk、maven压缩包解压,移动到......
  • 开发谷歌插件(一)
    之前开发了一款谷歌插件,因为很简单没有什么好记录的。这次记录下一款新的钱包功能的插件,其中遇到的问题,以及解决方案。首先遇到的问题就是唤醒:小狐狸钱包应该都用过,点击......
  • js插件fullcalendar配置项及样例
     部分配置项<linkhref="./plugins/fullcalendar-5.11.2/lib/main.css"rel="stylesheet"/><scripttype="text/javascript"language="javascript"src="./plugins/......
  • vue中swiper轮播插件的一个错误
    在引入插件的时候无论如何也不生效,后来发现2.添加HTML内容。Swiper7的默认容器是'.swiper',Swiper6之前是'.swiper-container'。<divclass="swiper"><divclass="s......
  • RLM:AMPED破解插件软件安装方法V3(Win/Mac/Linux)
    AMPED软件安装方法V3(Win/Mac/Linux)    一、AMPED软件的应用范围      二、win 1、拷贝RLM_Windows文件夹到C盘根目录"C:\";2、在C:......
  • KBL406-ASEMI插件整流桥KBL406
    编辑:llKBL406-ASEMI插件整流桥KBL406型号:KBL406品牌:ASEMI封装:KBL-4特性:整流桥正向电流:4A反向耐压:600V恢复时间:>2000ns引脚数量:4芯片个数:4芯片尺寸:84MIL浪涌电流:120A 漏电流:>......
  • KBL406-ASEMI插件整流桥KBL406
    编辑:llKBL406-ASEMI插件整流桥KBL406型号:KBL406品牌:ASEMI封装:KBL-4特性:整流桥正向电流:4A反向耐压:600V恢复时间:>2000ns引脚数量:4芯片个数:4芯片尺寸:84MIL浪涌电......
  • 一个不错的生成条形码的jquery插件兼介绍条形码
    首先介绍下条形码的原理先:条形码技术最早产生在风声鹤唳的二十年代,诞生于Westinghouse的实验室里。一位名叫JohnKermode性格古怪的发明家“异想天开......
  • 强烈推荐:240多个jQuery插件
    概述jQuery是继prototype之后又一个优秀的Javascript框架。其宗旨是—写更少的代码,做更多的事情。它是轻量级的js库(压缩后只有21k),这是其它的js库所不​​​​......