Ich hab hier schon ein paar Scripte bereitgestellt welche über SelectionSet die markierten Seiten einlesen.
Dieses kleine Script dient als Kopiervorlage und geht über alle markierte Seiten und springt diese auch an. Dadurch kann man z.B. Seiteneigenschaften setzen usw.
using System; using System.Diagnostics; using System.Threading; using System.Windows.Forms; using Eplan.EplApi.ApplicationFramework; using Eplan.EplApi.Base; using Eplan.EplApi.Scripting; class Program { [Start] public void Action() { // Get selected pages var pages = GetPages(); // Setup progressbar Progress progress = new Progress("EnhancedProgress"); progress.SetTitle("Do Something with pages"); progress.SetAllowCancel(true); progress.ShowImmediately(); progress.SetNeededSteps(pages.Length + 1); try { // Do something with pages foreach (var page in pages) { progress.SetActionText(page); progress.Step(1); SelectPage(page); MessageBox.Show(page, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { progress.EndPart(true); } } private static string[] GetPages() { ActionCallingContext actionCallingContext = new ActionCallingContext(); string pagesString = string.Empty; actionCallingContext.AddParameter("TYPE", "PAGES"); new CommandLineInterpreter().Execute("selectionset", actionCallingContext); actionCallingContext.GetParameter("PAGES", ref pagesString); string[] pages = pagesString.Split(';'); return pages; } private void SelectPage(string page) { ActionCallingContext actionCallingContext = new ActionCallingContext(); actionCallingContext.AddParameter("PAGENAME", page); new CommandLineInterpreter().Execute("edit", actionCallingContext); } }
Hallo Freund, wissen Sie, ob es eine Möglichkeit gibt, die Daten der ausgewählten Seiten zu erhalten, ohne sie eingeben zu müssen? Ich habe es getestet und bekomme es nicht hin..
Grüße
Hi,
can you post your question in english? The translation make no sense :)
Sorry man,
Im trying a code wich retrieves page properties of selected pages, and I used you selctionset template. Now i have a problem wich is that I have to go through all the pages to get the values and that takes time, so my question was if theres a way to get page properties or desired values within a page without going into all of them?
Thanks.
I think a faster way is to export all pages with all needed properties via label action. Create a label scheme with an table of contents.
Yes I use the “edit properties externally” option but sometimes when i import back it doesnt load correctly so thats why i thought using an script would solve that since you dont have to export .
[…] ähnlichem Konstrukt zugegriffen werden kann, müssen die erst selektiert werden. Das geht wie von Johann Weiher umgesetzt über […]
Hello, im having trouble making this script work with the SetPage property. basically the progress bar bugs out and skips the progressbar steps.
Hello, im trying this script adding the “XEsSetPagePropertyAction” and the “progress.Step(1)” doesn’t work properly. any help from the dev will be apreciated
Some actions from EPLAN overrides the progress value. You can use BeginPart() and EndPart() before EPLAN Actions and make your own steps.
Perhaps you also have to increase the SetNeededSteps().
Hello, can anybody create a script that creates a new page in current eplan project ?