2024-11-07 12:13:19 +08:00
|
|
|
|
using EPLAN.Harness.API;
|
|
|
|
|
using EPLAN.Harness.API.Plugins.Core;
|
2024-11-19 12:11:29 +08:00
|
|
|
|
using EPLAN.Harness.AppCore;
|
2024-11-07 12:13:19 +08:00
|
|
|
|
using Sinvo.EplanHpD.Plugin.WPFUI;
|
2024-12-10 17:02:58 +08:00
|
|
|
|
using Sinvo.EplanHpD.Plugin.WPFUI.Extension;
|
2024-11-15 15:02:16 +08:00
|
|
|
|
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
2024-11-07 12:13:19 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Reflection;
|
2024-11-14 19:22:25 +08:00
|
|
|
|
using System.Windows.Forms.Integration;
|
2024-11-07 12:13:19 +08:00
|
|
|
|
|
|
|
|
|
namespace Sinvo.EplanHpD.Plugin
|
|
|
|
|
{
|
2024-11-15 15:02:16 +08:00
|
|
|
|
#if DEBUG
|
2024-11-13 13:39:06 +08:00
|
|
|
|
public class DesignPluginEntry : EPLAN.Harness.API.Plugins.IHpDPlugin
|
2024-11-15 15:02:16 +08:00
|
|
|
|
#else
|
2024-11-16 08:42:16 +08:00
|
|
|
|
public class DesignPluginEntry : EPLAN.Harness.API.Plugins.IHpDPlugin
|
2024-11-15 15:02:16 +08:00
|
|
|
|
#endif
|
2024-11-07 12:13:19 +08:00
|
|
|
|
{
|
|
|
|
|
public string Name => "兴禾ProD插件-3D";
|
|
|
|
|
|
|
|
|
|
public string Author => "Sinvo";
|
|
|
|
|
|
2024-11-14 19:22:25 +08:00
|
|
|
|
public string Description => "兴禾EPLAN Harness proD 2.9 Studio插件,提供伺服电机线缆抓取功能";
|
2024-11-07 12:13:19 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取DLL版本
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Version Version => Assembly.GetAssembly(this.GetType()).GetName().Version;
|
|
|
|
|
|
|
|
|
|
public System.Drawing.Image ToolbarIcon
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var imageBytes = Resource.Sinvo;
|
|
|
|
|
if (imageBytes != null)
|
|
|
|
|
{
|
|
|
|
|
using (var ms = new MemoryStream(imageBytes))
|
|
|
|
|
{
|
|
|
|
|
return Image.FromStream(ms);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 19:22:25 +08:00
|
|
|
|
public string ToolbarText => "伺服电机线缆抓取";
|
2024-11-07 12:13:19 +08:00
|
|
|
|
|
|
|
|
|
public HpDModule Module => HpDModule.WorkSpace;
|
|
|
|
|
|
2024-11-26 10:34:31 +08:00
|
|
|
|
public string ToolbarTooltip => "伺服电机线缆抓取";
|
|
|
|
|
|
2024-11-07 12:13:19 +08:00
|
|
|
|
public void Execute(HpdApi api)
|
|
|
|
|
{
|
|
|
|
|
var doc = api.CurrentProject.GetActiveDocument();
|
2024-11-14 19:22:25 +08:00
|
|
|
|
var window = new LectotypeWindow(doc.ID);
|
|
|
|
|
ElementHost.EnableModelessKeyboardInterop(window);
|
2024-11-19 12:11:29 +08:00
|
|
|
|
var mainApp = BaseApp.ActiveApplication;
|
|
|
|
|
var helper = new System.Windows.Interop.WindowInteropHelper(window);
|
|
|
|
|
helper.Owner = mainApp.Handle;
|
2024-11-14 19:22:25 +08:00
|
|
|
|
window.Show();
|
2024-11-07 12:13:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
AppDomainDllLoader.SetLaoder();
|
2024-11-15 15:02:16 +08:00
|
|
|
|
ApplicationExt.InitApplication();
|
2024-11-07 12:13:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Terminate()
|
|
|
|
|
{
|
2024-11-13 13:39:06 +08:00
|
|
|
|
|
2024-11-07 12:13:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|