Hot News:

Mit Unterstützung durch:

  Foren auf CAD.de (alle Foren)
  EPLAN Electric P8
  Automatisiert Bearbeiten

Antwort erstellen  Neues Thema erstellen
CAD.de Login | Logout | Profil | Profil bearbeiten | Registrieren | Voreinstellungen | Hilfe | Suchen

Anzeige:

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen nächster neuer Beitrag | nächster älterer Beitrag
  
Gut zu wissen: Hilfreiche Tipps und Tricks aus der Praxis prägnant, und auf den Punkt gebracht für EPLAN
Autor Thema:  Automatisiert Bearbeiten (1536 mal gelesen)
Sbg Markus
Mitglied



Sehen Sie sich das Profil von Sbg Markus an!   Senden Sie eine Private Message an Sbg Markus  Schreiben Sie einen Gästebucheintrag für Sbg Markus

Beiträge: 516
Registriert: 24.11.2009

Eplan P8 2.7
Eplan P8 2.5
Eplan P8 2.3
Eplan P8 2.2
Eplan P8 2.0
Eplan 5.70.4.26200

erstellt am: 17. Aug. 2015 10:49    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities

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

Jonny Wire
Mitglied
Script-Troll


Sehen Sie sich das Profil von Jonny Wire an!   Senden Sie eine Private Message an Jonny Wire  Schreiben Sie einen Gästebucheintrag für Jonny Wire

Beiträge: 786
Registriert: 08.12.2008

EPLAN Electric P8
... in allen Versionen/Varianten

erstellt am: 17. Aug. 2015 11:22    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities Nur für Sbg Markus 10 Unities + Antwort hilfreich

Hallo Markus,

es ist nicht gerade die feine Art das ganze Script einzufügen.
Zusätzlich gibt es bereits eine Menge an Threads welche dieses Thema behandeln.

Nach dem Googlen ist mir auch aufgefallen dass hier die meisten von Dir sind. Du könntest du mal die Beispiele von mir anschauen:
http://suplanus.de/?s=tutorial
http://suplanus.de/buch

Bitte nicht falsch verstehen, aber es sollte auch ein Lerneffekt entstehen um einfache Actions in ein fertiges Script einzufügen.

------------------
Scripting in EPLAN ist einfach (toll)!

Scripte & Anwendungen rund um EPLAN!

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

Anzeige.:

Anzeige: (Infos zum Werbeplatz >>)

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen

nächster neuerer Beitrag | nächster älterer Beitrag
Antwort erstellen


Diesen Beitrag mit Lesezeichen versehen ... | Nach anderen Beiträgen suchen | CAD.de-Newsletter

Administrative Optionen: Beitrag schliessen | Archivieren/Bewegen | Beitrag melden!

Fragen und Anregungen: Kritik-Forum | Neues aus der Community: Community-Forum

(c)2023 CAD.de | Impressum | Datenschutz