You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jd_eplan/KPlan/Actions/KCheckProjectAction_Ex.cs

54 lines
1.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.IO;
using System.Windows;
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.DataModel;
using Eplan.EplApi.HEServices;
using KPlan.Util;
using Progress = Eplan.EplApi.Base.Progress;
namespace KPlan.Actions {
class KCheckProjectAction_Ex : Eplan.EplApi.ApplicationFramework.IEplAction {
public bool Execute(ActionCallingContext ctx) {
TCUtil.DO_NOTHING();
if (!TCUtil.CheckLogin()) {
return true;
}
SelectionSet selectionSet = new SelectionSet();
Project currentProject = selectionSet.GetCurrentProject(false);
if (currentProject == null) {
MessageBox.Show("没有选择项目");
return true;
}
string projectCode = EplanUtil.GetPropValue(currentProject.Properties.PROJ_DRAWINGNUMBER);
if (KUtil.IsEmpty(projectCode)) {
MessageBox.Show("项目编号不可为空");
return true;
}
string projPath = currentProject.ProjectDirectoryPath;
DirectoryInfo di = new DirectoryInfo(projPath);
projPath = di.Parent.FullName;
KUtil.Log("项目路径[" + currentProject.ProjectName + "]" + projPath);
if (!projPath.EndsWith("\\")) {
projPath += "\\";
}
string exportFile = projPath + currentProject.ProjectName + ".xml";
KUtil.Log("导出路径[" + currentProject.ProjectName + "]" + exportFile);
new Forms.KCheckProject_Ex(currentProject, projPath, exportFile, projectCode).Show();//.ShowDialog();
return true;
}
public bool OnRegister(ref string Name, ref int Ordinal) {
Name = "KCheckProjectAction_Ex";
Ordinal = 20;
return true;
}
public void GetActionProperties(ref ActionProperties actionProperties) {
//actionProperties.Description = "Action test with parameters.";
}
}
}