using System.IO; using System.Diagnostics; public class Zusatzfeld_vor_Revision_befüllen { [DeclareAction("Zusatzfeld_vor_Revision_befüllen")] public void Zusatzfeld_vor_Revision_befüllenVoid() { // < Allgemeine Daten: Anfang > // Projektdatei, Projektpfad, Projektname string sSelectedProjectData = string.Empty; // kompletter Pfad + Projektdateinamen + Erweiterung string sSelectedProjectName = string.Empty; // Projektname string sSelectedProjectPath = string.Empty; // Projektpfad // Projektdatei komplett CommandLineInterpreter oCLI = new CommandLineInterpreter(); Eplan.EplApi.ApplicationFramework.ActionCallingContext ctx = new Eplan.EplApi.ApplicationFramework.ActionCallingContext(); ctx.AddParameter("TYPE", "PROJECT"); bool bRet = oCLI.Execute("selectionset", ctx); // Action: Projektpfad if (bRet == true) { ctx.GetParameter("PROJECT", ref sSelectedProjectData); } // Projektpfad sSelectedProjectPath = System.IO.Path.GetDirectoryName(sSelectedProjectData); // Projektname sSelectedProjectName = System.IO.Path.GetFileNameWithoutExtension(sSelectedProjectData); // Bugfix 1.9.10 oCLI.Execute("EsGenerateConnections"); // < Allgemeine Daten: Ende > // Beschriftung Progress progress = new Progress("SimpleProgress"); progress.SetTitle("Zusatzfeld vor Revision befüllen"); progress.SetActionText(""); progress.ShowImmediately(); progress.BeginPart(25,""); progress.SetAllowCancel(true); if(!progress.Canceled()) { progress.BeginPart(25,"Zusatzfeld 1. Artikel befüllen"); ActionCallingContext RevisionsContext1 = new ActionCallingContext (); RevisionsContext1.AddParameter("PropertyId","20924"); //PropertyId: Zuordnung zum Zusatzfeld (Hier Stücklistengruppe) RevisionsContext1.AddParameter("PropertyIndex","1"); //PropertyIndex: Welcher hinterlegte Artikel des Betriebsmittels befüllt wird RevisionsContext1.AddParameter("PropertyValue","Artikel_vor_Revision"); //Mit was das Zusatzfeld befüllt werden soll (Hier "Artikel_vor_Revision") new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext1); //Link zum Forum Beitrag: progress.EndPart(); // https://ww3.cad.de/foren/ubb/Forum467/HTML/014226.shtml progress.BeginPart(25,"Zusatzfeld 2. Artikel befüllen"); ActionCallingContext RevisionsContext2 = new ActionCallingContext (); RevisionsContext2.AddParameter("PropertyId","20924"); RevisionsContext2.AddParameter("PropertyIndex","2"); RevisionsContext2.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext2); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 3. Artikel befüllen"); ActionCallingContext RevisionsContext3 = new ActionCallingContext (); RevisionsContext3.AddParameter("PropertyId","20924"); RevisionsContext3.AddParameter("PropertyIndex","3"); RevisionsContext3.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext3); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 4. Artikel befüllen"); ActionCallingContext RevisionsContext4 = new ActionCallingContext (); RevisionsContext4.AddParameter("PropertyId","20924"); RevisionsContext4.AddParameter("PropertyIndex","4"); RevisionsContext4.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext4); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 5. Artikel befüllen"); ActionCallingContext RevisionsContext5 = new ActionCallingContext (); RevisionsContext5.AddParameter("PropertyId","20924"); RevisionsContext5.AddParameter("PropertyIndex","5"); RevisionsContext5.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext5); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 6. Artikel befüllen"); ActionCallingContext RevisionsContext6 = new ActionCallingContext (); RevisionsContext6.AddParameter("PropertyId","20924"); RevisionsContext6.AddParameter("PropertyIndex","6"); RevisionsContext6.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext6); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 7. Artikel befüllen"); ActionCallingContext RevisionsContext7 = new ActionCallingContext (); RevisionsContext7.AddParameter("PropertyId","20924"); RevisionsContext7.AddParameter("PropertyIndex","7"); RevisionsContext7.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext7); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 8. Artikel befüllen"); ActionCallingContext RevisionsContext8 = new ActionCallingContext (); RevisionsContext8.AddParameter("PropertyId","20924"); RevisionsContext8.AddParameter("PropertyIndex","8"); RevisionsContext8.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext8); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 9. Artikel befüllen"); ActionCallingContext RevisionsContext9 = new ActionCallingContext (); RevisionsContext9.AddParameter("PropertyId","20924"); RevisionsContext9.AddParameter("PropertyIndex","9"); RevisionsContext9.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext9); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 10. Artikel befüllen"); ActionCallingContext RevisionsContext10 = new ActionCallingContext (); RevisionsContext10.AddParameter("PropertyId","20924"); RevisionsContext10.AddParameter("PropertyIndex","10"); RevisionsContext10.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext10); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 11. Artikel befüllen"); ActionCallingContext RevisionsContext11 = new ActionCallingContext (); RevisionsContext11.AddParameter("PropertyId","20924"); RevisionsContext11.AddParameter("PropertyIndex","11"); RevisionsContext11.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext11); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 12. Artikel befüllen"); ActionCallingContext RevisionsContext12 = new ActionCallingContext (); RevisionsContext12.AddParameter("PropertyId","20924"); RevisionsContext12.AddParameter("PropertyIndex","12"); RevisionsContext12.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext12); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 13. Artikel befüllen"); ActionCallingContext RevisionsContext13 = new ActionCallingContext (); RevisionsContext13.AddParameter("PropertyId","20924"); RevisionsContext13.AddParameter("PropertyIndex","13"); RevisionsContext13.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext13); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 14. Artikel befüllen"); ActionCallingContext RevisionsContext14 = new ActionCallingContext (); RevisionsContext14.AddParameter("PropertyId","20924"); RevisionsContext14.AddParameter("PropertyIndex","14"); RevisionsContext14.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext14); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 15. Artikel befüllen"); ActionCallingContext RevisionsContext15 = new ActionCallingContext (); RevisionsContext15.AddParameter("PropertyId","20924"); RevisionsContext15.AddParameter("PropertyIndex","15"); RevisionsContext15.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext15); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 16. Artikel befüllen"); ActionCallingContext RevisionsContext16 = new ActionCallingContext (); RevisionsContext16.AddParameter("PropertyId","20924"); RevisionsContext16.AddParameter("PropertyIndex","16"); RevisionsContext16.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext16); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 17. Artikel befüllen"); ActionCallingContext RevisionsContext17 = new ActionCallingContext (); RevisionsContext17.AddParameter("PropertyId","20924"); RevisionsContext17.AddParameter("PropertyIndex","17"); RevisionsContext17.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext17); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 18. Artikel befüllen"); ActionCallingContext RevisionsContext18 = new ActionCallingContext (); RevisionsContext18.AddParameter("PropertyId","20924"); RevisionsContext18.AddParameter("PropertyIndex","18"); RevisionsContext18.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext18); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 19. Artikel befüllen"); ActionCallingContext RevisionsContext19 = new ActionCallingContext (); RevisionsContext19.AddParameter("PropertyId","20924"); RevisionsContext19.AddParameter("PropertyIndex","19"); RevisionsContext19.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext19); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 20. Artikel befüllen"); ActionCallingContext RevisionsContext20 = new ActionCallingContext (); RevisionsContext20.AddParameter("PropertyId","20924"); RevisionsContext20.AddParameter("PropertyIndex","20"); RevisionsContext20.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext20); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 21. Artikel befüllen"); ActionCallingContext RevisionsContext21 = new ActionCallingContext (); RevisionsContext21.AddParameter("PropertyId","20924"); RevisionsContext21.AddParameter("PropertyIndex","21"); RevisionsContext21.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext21); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 22. Artikel befüllen"); ActionCallingContext RevisionsContext22 = new ActionCallingContext (); RevisionsContext22.AddParameter("PropertyId","20924"); RevisionsContext22.AddParameter("PropertyIndex","22"); RevisionsContext22.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext22); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 23. Artikel befüllen"); ActionCallingContext RevisionsContext23 = new ActionCallingContext (); RevisionsContext23.AddParameter("PropertyId","20924"); RevisionsContext23.AddParameter("PropertyIndex","23"); RevisionsContext23.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext23); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 24. Artikel befüllen"); ActionCallingContext RevisionsContext24 = new ActionCallingContext (); RevisionsContext24.AddParameter("PropertyId","20924"); RevisionsContext24.AddParameter("PropertyIndex","24"); RevisionsContext24.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext24); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 25. Artikel befüllen"); ActionCallingContext RevisionsContext25 = new ActionCallingContext (); RevisionsContext25.AddParameter("PropertyId","20924"); RevisionsContext25.AddParameter("PropertyIndex","25"); RevisionsContext25.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext25); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 26. Artikel befüllen"); ActionCallingContext RevisionsContext26 = new ActionCallingContext (); RevisionsContext26.AddParameter("PropertyId","20924"); RevisionsContext26.AddParameter("PropertyIndex","26"); RevisionsContext26.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext26); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 27. Artikel befüllen"); ActionCallingContext RevisionsContext27 = new ActionCallingContext (); RevisionsContext27.AddParameter("PropertyId","20924"); RevisionsContext27.AddParameter("PropertyIndex","27"); RevisionsContext27.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext27); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 28. Artikel befüllen"); ActionCallingContext RevisionsContext28 = new ActionCallingContext (); RevisionsContext28.AddParameter("PropertyId","20924"); RevisionsContext28.AddParameter("PropertyIndex","28"); RevisionsContext28.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext28); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 29. Artikel befüllen"); ActionCallingContext RevisionsContext29 = new ActionCallingContext (); RevisionsContext29.AddParameter("PropertyId","20924"); RevisionsContext29.AddParameter("PropertyIndex","29"); RevisionsContext29.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext29); progress.EndPart(); progress.BeginPart(25,"Zusatzfeld 30. Artikel befüllen"); ActionCallingContext RevisionsContext30 = new ActionCallingContext (); RevisionsContext30.AddParameter("PropertyId","20924"); RevisionsContext30.AddParameter("PropertyIndex","30"); RevisionsContext30.AddParameter("PropertyValue","Artikel_vor_Revision"); new CommandLineInterpreter().Execute("XEsSetPropertyAction",RevisionsContext30); progress.EndPart(); progress.EndPart(true); } } }