Möchte in folgendes Skript diesen Befehl (PmPageCalculatePropertiesOfPagesWithSamePropertyAction) zwischen Context1 + 2 einbauen, wie mach ich das ?
public class Script
{
[Start]
public bool AutoTreat(String strProjectName, String strSettingsFolder, Int32 nImportSettings, Int32 nCompleteProject, String strSelectionFilter)
{
Progress progress = new Progress("SimpleProgress");
progress.SetAllowCancel(true);
bool bResult = true;
int nActionsPercent = 100;
if (nCompleteProject == 0 && nImportSettings == 1)
{
progress.BeginPart(10, "ReadSelectionSettings");
nActionsPercent -= 10;
Eplan.EplApi.Base.Settings xmlSettings = new Eplan.EplApi.Base.Settings();
xmlSettings.ReadSettings(strSettingsFolder + @"\Selection.xml");
progress.EndPart();
}
progress.BeginPart(nActionsPercent,"");
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "reports");
ActionCallingContext context1 = new ActionCallingContext ();
context1.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context1.AddParameter("type","PROJECT");
}
else
{
context1.AddParameter("type","PAGES");
context1.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("reports",context1);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
if (nImportSettings == 1)
{
progress.BeginPart(25/10, "ReadSettings");
nActionsPercent -= 25;
Eplan.EplApi.Base.Settings xmlSettings = new Eplan.EplApi.Base.Settings();
xmlSettings.ReadSettings(strSettingsFolder + @"\Settings1.xml");
progress.EndPart();
}
}
if(!progress.Canceled())
{
Eplan.EplApi.Gui.Menu oMenu = new Eplan.EplApi.Gui.Menu();
progress.BeginPart(nActionsPercent/10, "label");
ActionCallingContext context2 = new ActionCallingContext ();
context2.AddParameter("configscheme","ERA - BMK Ausgabe");
context2.AddParameter("filterscheme","");
context2.AddParameter("sortscheme","");
context2.AddParameter("language","de_DE");
context2.AddParameter("destinationfile",@"$(PROJECTPATH)\Bauteil.prn");
context2.AddParameter("recrepeat","1");
context2.AddParameter("taskrepeat","1");
context2.AddParameter("showoutput","0");
context2.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context2.AddParameter("type","PROJECT");
}
else
{
context2.AddParameter("type","PAGES");
context2.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("label",context2);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
if (nImportSettings == 1)
{
progress.BeginPart(25/10, "ReadSettings");
nActionsPercent -= 25;
Eplan.EplApi.Base.Settings xmlSettings = new Eplan.EplApi.Base.Settings();
xmlSettings.ReadSettings(strSettingsFolder + @"\Settings2.xml");
progress.EndPart();
}
}
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "label");
ActionCallingContext context3 = new ActionCallingContext ();
context3.AddParameter("configscheme","ERA - Schilder Ausgabe");
context3.AddParameter("filterscheme","");
context3.AddParameter("sortscheme","");
context3.AddParameter("language","de_DE");
context3.AddParameter("destinationfile",@"C:\Eplan\Datentransfer\Projektdaten.txt");
context3.AddParameter("recrepeat","1");
context3.AddParameter("taskrepeat","1");
context3.AddParameter("showoutput","0");
context3.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context3.AddParameter("type","PROJECT");
}
else
{
context3.AddParameter("type","PAGES");
context3.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("label",context3);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
if (nImportSettings == 1)
{
progress.BeginPart(25/10, "ReadSettings");
nActionsPercent -= 25;
Eplan.EplApi.Base.Settings xmlSettings = new Eplan.EplApi.Base.Settings();
xmlSettings.ReadSettings(strSettingsFolder + @"\Settings3.xml");
progress.EndPart();
}
}
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "label");
ActionCallingContext context4 = new ActionCallingContext ();
context4.AddParameter("configscheme","ERA - RS2 Daten");
context4.AddParameter("filterscheme","");
context4.AddParameter("sortscheme","");
context4.AddParameter("language","de_DE");
context4.AddParameter("destinationfile",@"G:\rs2\EPLAN\Einzelteile_$(PROJECTNAME).txt");
context4.AddParameter("recrepeat","1");
context4.AddParameter("taskrepeat","1");
context4.AddParameter("showoutput","0");
context4.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context4.AddParameter("type","PROJECT");
}
else
{
context4.AddParameter("type","PAGES");
context4.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("label",context4);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "print");
ActionCallingContext context5 = new ActionCallingContext ();
context5.AddParameter("printername",@"\\ERA-SERVER1\EG-B2-KOP-FAX");
context5.AddParameter("pagefiltername","Stücklisten");
context5.AddParameter("number","1");
context5.AddParameter("printcollate","0");
context5.AddParameter("printreverse","0");
context5.AddParameter("printchangedpages","0");
context5.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context5.AddParameter("type","PROJECT");
}
else
{
context5.AddParameter("type","PAGES");
context5.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("print",context5);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "print");
ActionCallingContext context6 = new ActionCallingContext ();
context6.AddParameter("printername",@"\\ERA-SERVER1\EG-B2-KOP-FAX");
context6.AddParameter("pagefiltername","Aufbauzeichnung");
context6.AddParameter("number","1");
context6.AddParameter("printcollate","0");
context6.AddParameter("printreverse","0");
context6.AddParameter("printchangedpages","0");
context6.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context6.AddParameter("type","PROJECT");
}
else
{
context6.AddParameter("type","PAGES");
context6.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("print",context6);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "print");
ActionCallingContext context7 = new ActionCallingContext ();
context7.AddParameter("printername",@"\\ERA-SERVER1\EG-B2-STAHLBAU");
context7.AddParameter("pagefiltername","Aufbauzeichnung_Sonderstahlbau");
context7.AddParameter("number","1");
context7.AddParameter("printcollate","0");
context7.AddParameter("printreverse","0");
context7.AddParameter("printchangedpages","0");
context7.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context7.AddParameter("type","PROJECT");
}
else
{
context7.AddParameter("type","PAGES");
context7.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("print",context7);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "print");
ActionCallingContext context8 = new ActionCallingContext ();
context8.AddParameter("printername",@"\\ERA-SERVER1\EG-B2-STAHLBAU");
context8.AddParameter("pagefiltername","Aufbauzeichnung");
context8.AddParameter("number","1");
context8.AddParameter("printcollate","0");
context8.AddParameter("printreverse","0");
context8.AddParameter("printchangedpages","0");
context8.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context8.AddParameter("type","PROJECT");
}
else
{
context8.AddParameter("type","PAGES");
context8.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("print",context8);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "print");
ActionCallingContext context9 = new ActionCallingContext ();
context9.AddParameter("printername",@"\\ERA-SERVER1\EG-B2-KOP-FAX");
context9.AddParameter("pagefiltername","Schaltplan");
context9.AddParameter("number","1");
context9.AddParameter("printcollate","0");
context9.AddParameter("printreverse","0");
context9.AddParameter("printchangedpages","0");
context9.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context9.AddParameter("type","PROJECT");
}
else
{
context9.AddParameter("type","PAGES");
context9.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("print",context9);
progress.EndPart();
}
nActionsPercent = 100;
if(!progress.Canceled())
{
progress.BeginPart(nActionsPercent/10, "compress");
ActionCallingContext context10 = new ActionCallingContext ();
context10.AddParameter("configscheme","ERA - Überflüssige Projektdaten entfernen");
context10.AddParameter("usefilter","0");
context10.AddParameter("filterscheme","Fluid");
context10.AddParameter("ProjectName",strProjectName);
if (nCompleteProject == 1)
{
context10.AddParameter("type","PROJECT");
}
else
{
context10.AddParameter("type","PAGES");
context10.AddParameter("PAGEFILTERNAME", strSelectionFilter);
}
bResult &= new CommandLineInterpreter().Execute("compress",context10);
progress.EndPart();
}
progress.EndPart(true);
return bResult;
}
}
------------------
---------------
mfg Markus
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP