Exemple #1
0
    public void ActionFunctionInfo()
    {
        Eplan.EplApi.Base.Settings oSettingsRead = new Eplan.EplApi.Base.Settings();
        // Datenbank Einstellung auslesen
        string sArtikelDB   = oSettingsRead.GetStringSetting("USER.PartsManagementGui.Database", 0);
        string sProjektDB   = oSettingsRead.GetStringSetting("COMPANY.PrjManagementGUI.Database.SQL", 0);
        string sTranslateDB = oSettingsRead.GetStringSetting("USER.TRANSLATEGUI.DATABASE_NAME_SQL", 0);

        // Verzeichniseinstellungen auslesen
        string sVerzeichnis = oSettingsRead.GetStringSetting("USER.ModalDialogs.PathsScheme.LastUsed", 0); // + SchemeName + ".Data.", 0);

        // Überflüssige Zeichen abschneiden
        int len = sArtikelDB.Length > 0 ? sArtikelDB.Length - 6 : 0;

        sArtikelDB = sArtikelDB.Substring(0, len);

        len        = sProjektDB.Length > 0 ? sProjektDB.Length - 6 : 0;
        sProjektDB = sProjektDB.Substring(0, len);

        len          = sTranslateDB.Length > 0 ? sTranslateDB.Length - 6 : 0;
        sTranslateDB = sTranslateDB.Substring(0, len);
        // Ausgabe
        MessageBox.Show("Artikeldatenbank: " + sArtikelDB + Environment.NewLine + Environment.NewLine
                        + "Verzeichnis: " + sVerzeichnis + Environment.NewLine + Environment.NewLine
                        + "Projektdatenbank: " + sProjektDB + Environment.NewLine + Environment.NewLine
                        + "Uebersetzungsdatenbank: " + sTranslateDB, "Aktuelle Einstellungen", MessageBoxButtons.OK, MessageBoxIcon.Information);

        return;
    }
Exemple #2
0
    public void OpenProjectAndSetPartsDbVoid(string PROJECT, string DATABASE)
    {
        if (File.Exists(DATABASE))
        {
            Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
            oSettings.SetStringSetting("USER.PartsManagementGui.Database", DATABASE, 0);
            MessageBox.Show("Eingestellte Datenbank:\n" + DATABASE, "OpenProjectAndSetPartsDb", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
        {
            MessageBox.Show("Datenbank nicht gefunden:\n" + DATABASE + "\n\n Es wurde keine Änderung an den Einstellungen vorgenommen.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        if (File.Exists(PROJECT))
        {
            ActionCallingContext accProjectOpen = new ActionCallingContext();
            accProjectOpen.AddParameter("Project", PROJECT);
            new CommandLineInterpreter().Execute("ProjectOpen", accProjectOpen);
        }
        else
        {
            MessageBox.Show("Projekt nicht gefunden:\n" + PROJECT, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        return;
    }
    public void SetSortCodeAction()
    {
        //Use a Command Line Interpreter to call the Action
        CommandLineInterpreter CLI = new CommandLineInterpreter();

        Eplan.EplApi.Base.Settings set = new Eplan.EplApi.Base.Settings();
        if(!set.ExistSetting("USER.SCRIPTS.SORTCODE"))
        {
            bool bOk = set.AddNumericSetting("USER.SCRIPTS.SORTCODE",  new int[] { 0 },
                new Range[] { new Range { FromValue = 0, ToValue = 32768}}, "Sort code setting", new int[] { 0 },
                ISettings.CreationFlag.Insert);
        }

        int index = set.GetNumericSetting("USER.SCRIPTS.SORTCODE", 0);

        ActionCallingContext ctx1 = new ActionCallingContext();
        ctx1.AddParameter("propertyID","20809"); //Sort code
        ctx1.AddParameter("propertyIndex","0");
        ctx1.AddParameter("propertyValue", index.ToString());
        CLI.Execute("XEsSetPropertyAction", ctx1);

        set.SetNumericSetting("USER.SCRIPTS.SORTCODE", ++index, 0);

        return;
    }
    public void OpenProjectAndSetPartsDbVoid(string PROJECT, string DATABASE)
    {
        if (File.Exists(DATABASE))
        {
            Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
            oSettings.SetStringSetting("USER.PartsManagementGui.Database", DATABASE, 0);
            MessageBox.Show("Set database:\n" + DATABASE, "OpenProjectAndSetPartsDb", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
        {
            MessageBox.Show("Database not found:\n" + DATABASE + "\n\n There was no change to the settings.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        if (File.Exists(PROJECT))
        {
            ActionCallingContext accProjectOpen = new ActionCallingContext();
            accProjectOpen.AddParameter("Project", PROJECT);
            new CommandLineInterpreter().Execute("ProjectOpen", accProjectOpen);
        }
        else
        {
            MessageBox.Show("Project not found:\n" + PROJECT, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        return;
    }
    public void OpenProjectAndSetPartsDbVoid(string PROJECT,string DATABASE)
    {
        if (File.Exists(DATABASE))
        {
            Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
            oSettings.SetStringSetting("USER.PartsManagementGui.Database", DATABASE, 0);
            MessageBox.Show("Eingestellte Datenbank:\n" + DATABASE, "OpenProjectAndSetPartsDb", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
        {
            MessageBox.Show("Datenbank nicht gefunden:\n" + DATABASE + "\n\n Es wurde keine Änderung an den Einstellungen vorgenommen.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        if (File.Exists(PROJECT))
        {
            ActionCallingContext accProjectOpen = new ActionCallingContext();
            accProjectOpen.AddParameter("Project", PROJECT);
            new CommandLineInterpreter().Execute("ProjectOpen", accProjectOpen);
        }
        else
        {
            MessageBox.Show("Projekt nicht gefunden:\n" + PROJECT, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        return;
    }
Exemple #6
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetBoolSetting("USER.EnfMVC.ContextMenuSetting.ShowExtended", true, 0);

        MessageBox.Show("Setting has been activated. EPLAN restart required.");

        return;
    }
Exemple #7
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetStringSetting("USER.TrDMProject.UserData.Identification", "TEST", 0);

        MessageBox.Show("Setting has been set.");

        return;
    }
Exemple #8
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.ReadSettings(@"C:\test\test.xml");

        MessageBox.Show("Einstellungen wurden importiert.");

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetNumericSetting("USER.SYSTEM.GUI.LAST_PROJECTS_COUNT", 11, 0);

        MessageBox.Show("Setting has been set.");

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        int intSetting = oSettings.GetNumericSetting("USER.MF.PREVIEW.MINCOLWIDTH", 0);

        MessageBox.Show("Minimum width of the tiles in the preview: " + intSetting.ToString());

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.ReadSettings(@"C:\test\test.xml");

        MessageBox.Show("Einstellungen wurden importiert.");

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.ReadSettings(@"C:\test\test.xml");

        MessageBox.Show("Settings have been imported.");

        return;
    }
Exemple #13
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        string strName = oSettings.GetStringSetting("USER.TrDMProject.UserData.Longname", 0);

        MessageBox.Show("Hello " + strName + "!");

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        string strName = oSettings.GetStringSetting(
            "USER.TrDMProject.UserData.Longname",
            0
            );

        MessageBox.Show("Hallo " + strName + "!");

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetStringSetting(
            "USER.TrDMProject.UserData.Identification",
            "TEST",
            0
            );

        MessageBox.Show("Einstellung wurde gesetzt.");

        return;
    }
    public void UnRegister()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetBoolSetting(
            "USER.EnfMVC.ContextMenuSetting.ShowIdentifier",
            false,
            0
            );

        MessageBox.Show("Context menu ID: invisible");

        return;
    }
    public void Register()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetBoolSetting(
            "USER.EnfMVC.ContextMenuSetting.ShowIdentifier",
            true,
            0
            );

        MessageBox.Show("Kontextmenü-ID: sichtbar");

        return;
    }
Exemple #18
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        int intSetting = oSettings.GetNumericSetting(
            "USER.MF.PREVIEW.MINCOLWIDTH",
            0
            );

        MessageBox.Show("Mindestbreite der Kacheln in der Vorschau: "
                        + intSetting.ToString());

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        int intSetting = oSettings.GetNumericSetting(
            "USER.MF.PREVIEW.MINCOLWIDTH",
            0
            );

        MessageBox.Show("Mindestbreite der Kacheln in der Vorschau: "
            + intSetting.ToString());

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetNumericSetting(
            "USER.SYSTEM.GUI.LAST_PROJECTS_COUNT",
            11,
            0
            );

        MessageBox.Show("Einstellung wurde gesetzt.");

        return;
    }
    public void Register()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetBoolSetting(
            "USER.EnfMVC.ContextMenuSetting.ShowIdentifier",
            true,
            0
            );

        MessageBox.Show("Kontextmenü-ID: sichtbar");

        return;
    }
    public void ResetSortCodeAction()
    {
        //Use a Command Line Interpreter to call the Action
        CommandLineInterpreter CLI = new CommandLineInterpreter();

        Eplan.EplApi.Base.Settings set = new Eplan.EplApi.Base.Settings();
        if(!set.ExistSetting("USER.SCRIPTS.SORTCODE"))
        {
            bool bOk = set.AddNumericSetting("USER.SCRIPTS.SORTCODE",  new int[] { 0 },
                new Range[] { new Range { FromValue = 0, ToValue = 32768}}, "Sort code setting", new int[] { 0 },
                ISettings.CreationFlag.Insert);
        }

        set.SetNumericSetting("USER.SCRIPTS.SORTCODE", 0, 0);

        return;
    }
Exemple #23
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetBoolSetting(
            "USER.EnfMVC.ContextMenuSetting.ShowExtended",
            true,
            0
            );

        MessageBox.Show(
            "Einstellung wurde aktiviert. EPLAN-Neustart erforderlich."
            );

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        oSettings.SetBoolSetting(
            "USER.EnfMVC.ContextMenuSetting.ShowExtended",
            true,
            0
            );

        MessageBox.Show(
            "Einstellung wurde aktiviert. EPLAN-Neustart erforderlich."
            );

        return;
    }
Exemple #25
0
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        bool bolSetting = oSettings.GetBoolSetting("USER.XUserSettingsGui.UseLoginName", 0);

        if (bolSetting)
        {
            MessageBox.Show("Setting is activated.");
        }
        else
        {
            MessageBox.Show("Setting is deactivated.");
        }

        return;
    }
Exemple #26
0
    public void SetValues()
    {
        //The Settings object allows us to manipulate EPLAN settings.
        Eplan.EplApi.Base.Settings setting = new Eplan.EplApi.Base.Settings();

        //For each index, we set the desired value.
        //Index 0 is set to value -16002, which means "From layer" and should probably left untouched.
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", -16002, 0);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 1.3, 1);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 1.8, 2);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 2.5, 3);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 3.5, 4);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 5.0, 5);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 7.0, 6);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 10.0, 7);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 14.0, 8);
        setting.SetDoubleSetting("STATION.GedViewer.TextStyle.mm.EN.Heights", 20.0, 9);
    }
        public void MyFunction()
        {
            Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
            //Einstellung auslesen
            bool bolSetting = oSettings.GetBoolSetting("USER.ModalDialogs.XSdCustomToolbarComponent.ExtendedActionList", 0);

            //wenn nicht gesetzt, setzen
            if (bolSetting == false)
            {
                oSettings.SetBoolSetting("USER.ModalDialogs.XSdCustomToolbarComponent.ExtendedActionList", true, 0);
                MessageBox.Show("Die Einstellung wurde 'aktiviert'.", "USER.ModalDialogs.XSdCustomToolbarComponent.ExtendedActionList", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //wenn gesetzt, zurücksetzen
            else if (bolSetting == true)
            {
                oSettings.SetBoolSetting("USER.ModalDialogs.XSdCustomToolbarComponent.ExtendedActionList", false, 0);
                MessageBox.Show("Die Einstellung wurde 'deaktiviert'.", "USER.ModalDialogs.XSdCustomToolbarComponent.ExtendedActionList", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return;
        }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        bool bolSetting = oSettings.GetBoolSetting(
            "USER.XUserSettingsGui.UseLoginName",
            0
            );

        if (bolSetting)
        {
            MessageBox.Show("Einstellung ist aktiviert.");
        }
        else
        {
            MessageBox.Show("Einstellung ist deaktiviert.");
        }

        return;
    }
    public void Function()
    {
        Eplan.EplApi.Base.Settings oSettings =
            new Eplan.EplApi.Base.Settings();

        bool bolSetting = oSettings.GetBoolSetting(
            "USER.XUserSettingsGui.UseLoginName",
            0
            );

        if (bolSetting)
        {
            MessageBox.Show("Einstellung ist aktiviert.");
        }
        else
        {
            MessageBox.Show("Einstellung ist deaktiviert.");
        }

        return;
    }