Jump to content

Recommended Posts

OMEFA_SPE
Posted

Buongiorno a tutti,

ho difficoltà nell'utilizzo dei Typical Script in Eplan eBuild, sia per impostare dei parametri progetto che nel fare eseguire azioni specifiche al progetto EPlan P8.

 

Nel mio caso specifico, tramite script, vorrei settare la proprietà progetto "campo aggiuntivo 10901 [1]" al valore scritto in una variabile di eBuild. L' esempio classico è far impostare il modello di macchina.

 

Inoltre, con un altro script, far partire le azioni classiche di Eplan P8 (valutazioni, traduzioni, etc...)

 

Ho certezza che il parametro della variabile venga pescato correttamente dallo script. Anche il parametro ProjectName sembra corretto (ho fatto dei debug tramite MessageBox).

 

Qualcuno ha più dimestichezza?

 

Ecco il tipico script che vorrei far funzionare:

 

 

 

using System.Windows.Forms;
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;

public class SetProjectProperty10901
{
    [Start]
    public void Execute(string ProjectName, string GRU_MOD)
    
            
    {
        CommandLineInterpreter oCLI = new CommandLineInterpreter();
        ActionCallingContext acc = new ActionCallingContext();

        acc.AddParameter("projectName", ProjectName);
        acc.AddParameter("PropertyId",          "10901");
        acc.AddParameter("Propertyindex",       "1");         // indice 1 = primo campo supplementare
        acc.AddParameter("Propertyvalue",       GRU_MOD);
        
        MessageBox.Show(ProjectName);
        MessageBox.Show(GRU_MOD);

        oCLI.Execute("XEsSetProjectPropertyAction", acc);
        
        return;
    }
}

 

 

 

Grazie a tutti

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...