Eplan Addin插件制作

Addin 插件入门

https://blog.csdn.net/zhshspark/article/details/116831152
我是看这篇文章做的.

脚本只能做一小部分操作 , 所以花了很多时间入门 , 学习编程 , 还是需要耐心和细心 …

做了插件入口 , 才能更好的去实现自己的功能 .

AddIn代码

最好是写完AddIn代码 , 就直接注册进去 , 防止做的功能多了 , 出现问题 ,
上面注释的代码是帮助给的示例代码 , 我用不同的电脑注册文件会有莫名其妙的问题 , 后来在别的电脑上用未注释的代码做的 , 如果有问题 , 可以研究一下 .

using Eplan.EplApi.ApplicationFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EplAPITest.Forms;
using Eplan.EplApi.Gui;

namespace EplAPITest
{
    public class TestAddin : IEplAddIn
    {
        public bool OnExit()
        {
            return true;
        }

        public bool OnInit()
        {
            return true;
        }

        public bool OnInitGui()
        {
            
            return true;
        }

        public bool OnRegister(ref bool bLoadOnStart)
        {

            //var ribbonBar = new Eplan.EplApi.Gui.RibbonBar();
            //ribbonBar.AddCommand("CSharpAction", "CSharpAction");
            var newTab = new Eplan.EplApi.Gui.RibbonBar().AddTab("APITest");
            var commandGroup = newTab.AddCommandGroup("APItest1");
            var command = commandGroup.AddCommand("CSharpAction", "XPartsManagementStart");
            return true;
        }

        public bool OnUnregister()
        {
            var ribbonBar = new Eplan.EplApi.Gui.RibbonBar();
            return ribbonBar.RemoveCommand("CSharpAction");
        }
    }
}

AcitonTest.cs代码

操作实现代码 , 显示一个窗口 , 窗口做一些功能

using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Base;
using Eplan.EplApi.DataModel;
using Eplan.EplApi.Gui;
using EplAPITest.Base;
using EplAPITest.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.Control;

namespace EplAPITest
{
    class ActionTest : IEplAction,IActionCallingContext
    {
        public bool Execute(ActionCallingContext oActionCallingContext)
        {
            FstForm fstForm = new FstForm();
            fstForm.TopMost = true; 
            fstForm.Show();
            return true;
        }

        public void GetActionProperties(ref ActionProperties actionProperties)
        {
        }

        public bool OnRegister(ref string Name, ref int Ordinal)
        {
            Name = "CSharpAction";
            Ordinal = 20;
            return true;
        }
    }
}

不免费 ! 目前实现了 , 页面管理 , 部件管理 , 自动命名功能(可以给设备,中断点,命名定义点,单层端子,双层端子,命名。功能还在测试中)需要的可以私信我 .

淘宝链接只有页面管理功能,其他需求请私聊!
淘宝链接,需求功能和价格请私聊,上架产品仅有页面管理功能

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值