1# 引用

C:\AVEVA\Marine\OH12.1.SP4\Aveva.ApplicationFramework.dll

C:\AVEVA\Marine\OH12.1.SP4\Aveva.ApplicationFramework.Presentation.dll

2# 引用命名空间,

using Aveva.ApplicationFramework.Presentation;
using Aveva.ApplicationFramework;

3# 继承接口Iaddin

4#写代码

  public class Class1 : IAddin
{
public string Name { get; } public string Description { get; } public void Start(ServiceManager serviceManager)
{
System.Windows.Forms.MessageBox.Show("欢迎使用本插件!");
} public void Stop()
{
System.Windows.Forms.MessageBox.Show("感谢使用本插件!");
}
}

Aveva Marine C# 二次开发入门001-LMLPHP

5# 配置插件加载

把编译生成的dll复制到Aveva Marine的安装目录下下面

打开以下文件,再最后加入自己的插件的名称

‪C:\AVEVA\Marine\OH12.1.SP4\HullDesignAddins.xml

Aveva Marine C# 二次开发入门001-LMLPHP

6# 启动am,加载插件成功

Aveva Marine C# 二次开发入门001-LMLPHP

05-11 18:17