|
|
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.";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|