Sicher genug, der Fehler war dort, wo Sie ihn angegeben haben.
Eine andere Abfrage habe ich, nämlich dass bei der Auswahl mehrerer Seiten und der Ausführung des Skripts die Felder von "EPLAN.Page.UserSupplementaryField1" mit dem gleichen Inhalt überschrieben werden, obwohl eigentlich unterschiedliche Texte in diesen Eigenschaften eingetragen wurden. Gibt es eine Möglichkeit, dieses Problem zu lösen und jeden Wert unabhängig von den Seiten scrollen zu lassen?
Ich lasse den Code, den ich mit eurer Hilfe erstellt habe, mal schauen, ob er jemandem hilft oder etwas verbessert oder vereinfacht werden kann
using System;
using System.IO;
using System.Windows.Forms;
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Base;
using Eplan.EplApi.Scripting;
public class RevScript
{
[Start]
public void MyFunction()
{
Eplan.EplApi.Base.Settings oUsuari = new Eplan.EplApi.Base.Settings();
string usuari = oUsuari.GetStringSetting("USER.TrDMProject.UserData.Longname",0);
DateTime DiaActual = DateTime.Now;
string data = String.Format(DiaActual.ToShortDateString(),"dd/mm/aaaa");
string rev1 = string.Empty;
string data1 = string.Empty;
string cad1 = string.Empty;
string rev2 = string.Empty;
string data2 = string.Empty;
string cad2 = string.Empty;
string rev3 = string.Empty;
string data3 = string.Empty;
string cad3 = string.Empty;
CommandLineInterpreter cli1 = new CommandLineInterpreter();
ActionCallingContext acc1 = new ActionCallingContext();
acc1.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField10");
acc1.AddParameter("PropertyIndex", "0");
cli1.Execute("XEsGetPagePropertyAction",acc1);
acc1.GetParameter("PropertyValue", ref rev1);
CommandLineInterpreter cli2 = new CommandLineInterpreter();
ActionCallingContext acc2 = new ActionCallingContext();
acc2.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField11");
acc2.AddParameter("PropertyIndex", "0");
cli2.Execute("XEsGetPagePropertyAction",acc2);
acc2.GetParameter("PropertyValue", ref data1);
CommandLineInterpreter cli3 = new CommandLineInterpreter();
ActionCallingContext acc3 = new ActionCallingContext();
acc3.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField12");
acc3.AddParameter("PropertyIndex", "0");
cli3.Execute("XEsGetPagePropertyAction",acc3);
acc3.GetParameter("PropertyValue", ref cad1);
CommandLineInterpreter cli4 = new CommandLineInterpreter();
ActionCallingContext acc4 = new ActionCallingContext();
acc4.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField13");
acc4.AddParameter("PropertyIndex", "0");
cli4.Execute("XEsGetPagePropertyAction",acc4);
acc4.GetParameter("PropertyValue", ref rev2);
CommandLineInterpreter cli5 = new CommandLineInterpreter();
ActionCallingContext acc5 = new ActionCallingContext();
acc5.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField14");
acc5.AddParameter("PropertyIndex", "0");
cli5.Execute("XEsGetPagePropertyAction",acc5);
acc5.GetParameter("PropertyValue", ref data2);
CommandLineInterpreter cli6 = new CommandLineInterpreter();
ActionCallingContext acc6 = new ActionCallingContext();
acc6.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField15");
acc6.AddParameter("PropertyIndex", "0");
cli6.Execute("XEsGetPagePropertyAction",acc6);
acc6.GetParameter("PropertyValue", ref cad2);
CommandLineInterpreter cli7 = new CommandLineInterpreter();
ActionCallingContext acc7 = new ActionCallingContext();
acc7.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField16");
acc7.AddParameter("PropertyIndex", "0");
cli7.Execute("XEsGetPagePropertyAction",acc7);
acc7.GetParameter("PropertyValue", ref rev3);
CommandLineInterpreter cli8 = new CommandLineInterpreter();
ActionCallingContext acc8 = new ActionCallingContext();
acc8.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField17");
acc8.AddParameter("PropertyIndex", "0");
cli8.Execute("XEsGetPagePropertyAction",acc8);
acc8.GetParameter("PropertyValue", ref data3);
CommandLineInterpreter cli9 = new CommandLineInterpreter();
ActionCallingContext acc9 = new ActionCallingContext();
acc9.AddParameter("PropertyIdentName", "EPLAN.Page.UserSupplementaryField18");
acc9.AddParameter("PropertyIndex", "0");
cli9.Execute("XEsGetPagePropertyAction",acc9);
acc9.GetParameter("PropertyValue", ref cad3);
acc4.AddParameter("PropertyValue", rev1);
cli4.Execute("XEsSetPagePropertyAction",acc4);
acc5.AddParameter("PropertyValue", data1);
cli5.Execute("XEsSetPagePropertyAction",acc5);
acc6.AddParameter("PropertyValue", cad1);
cli6.Execute("XEsSetPagePropertyAction",acc6);
acc7.AddParameter("PropertyValue", rev2);
cli7.Execute("XEsSetPagePropertyAction",acc7);
acc8.AddParameter("PropertyValue", data2);
cli8.Execute("XEsSetPagePropertyAction",acc8);
acc9.AddParameter("PropertyValue", cad2);
cli9.Execute("XEsSetPagePropertyAction",acc9);
acc1.AddParameter("PropertyValue", "REV. ");
cli1.Execute("XEsSetPagePropertyAction",acc1);
acc2.AddParameter("PropertyValue", data);
cli2.Execute("XEsSetPagePropertyAction",acc2);
acc3.AddParameter("PropertyValue", usuari);
cli3.Execute("XEsSetPagePropertyAction",acc3);
return;
}
}
Vielen Dank für die Hilfe!
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP