Blog

Eplan.EplApi.MasterData in Scripting verfügbar

Ein kleiner Schritt in der EPLAN Versionsnummer, ein großer Schritt im Scripting. Ab Version EPLAN 2022 Update 1 ist es nun möglich auf fast alle Klassen in Eplan.EplApi.MasterData im Scripting zuzugreifen. Ausnahmen (inkl. Unterklassen):

  • MDSymbolLibrary
  • MDSymbolLibraryPropertyList
  • MDSymbol
  • MDSymbolPropertyList
  • MDSymbolVariant
  • MDTranslationDatabase

EPLAN hat dem Thema auch ein kleines Kapitel in der Hilfe gewidmet.

Von |2021-11-24T14:15:53+01:002021-11-24|EPLAN, EPLAN-Scripts|

WPF API-Addins mit Übersetzungen

Einige unserer Produkte sind auch mehrsprachig. Einige API-Addins besitzen eine GUI mit WPF, welche die Übersetzungen aus einer Resource-Datei in einer referenzierten Assembly laden.

 

Leider gibt es beim Öffnen des Windows dann folgenden Fehler:

The file or assembly LocalizationExample.Translations, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null or a dependency of it was not found.
Assembly loader: LocalizationExample.Translations, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null not found
The file or assembly LocalizationExample.Translations, PublicKeyToken=null or a dependency of it was not found.
Assembly loader: LocalizationExample.Translations, PublicKeyToken=null not found
The LocalizationExampleAction action with the /_cmdline:LocalizationExampleAction parameters of the LocalizationExample.EplAddIn.Gui module has failed. Could not load file or assembly 'LocalizationExample.Translations, PublicKeyToken=null' or one of its dependencies. Das System kann die angegebene Datei nicht finden.

 

Ich habe mir mit Fusion++ mal angesehen, was nicht geladen wurde:

LOG: Attempting download of new URL file:///C:/Users/moz/AppData/Roaming/EPLAN/ShadowCopyAssemblies/8980/LocalizationExample.EplAddIn.Gui/bin/en-US/LocalizationExample.EplAddIn.Gui.resources.DLL.
LOG: Attempting download of new URL file:///C:/Users/moz/AppData/Roaming/EPLAN/ShadowCopyAssemblies/8980/LocalizationExample.EplAddIn.Gui/bin/en-US/LocalizationExample.EplAddIn.Gui.resources/LocalizationExample.EplAddIn.Gui.resources.DLL.
LOG: Attempting download of new URL file:///C:/Users/moz/AppData/Roaming/EPLAN/ShadowCopyAssemblies/8980/LocalizationExample.EplAddIn.Gui/bin/en-US/LocalizationExample.EplAddIn.Gui.resources.EXE.
LOG: Attempting download of new URL file:///C:/Users/moz/AppData/Roaming/EPLAN/ShadowCopyAssemblies/8980/LocalizationExample.EplAddIn.Gui/bin/en-US/LocalizationExample.EplAddIn.Gui.resources/LocalizationExample.EplAddIn.Gui.resources.EXE.

 

Der Assembly-Loader sucht nach der falschen Datei… mhh, komisch. Denn der Zugriff außerhalb von WPF, sprich im C# Code, funktioniert ohne Probleme.
Meine Vermutung, dass WPF die Resource-Datei nicht findet hat sich betätigt. Darum greife ich nun BEVOR ich ein WPF-Control erstelle, einmal auf die Assembly zu.

Hab das die Lösung auf GitHub mit einem Beispielprojekt dokumentiert.

Von |2021-09-16T08:38:57+02:002021-09-16|EPLAN, EPLAN-API|

EPLAN 2022: Scripting Neuerungen

2021-06-04

Die Betaversion von EPLAN 2022 ist nun verfügbar. Folgende Änderungen an den Actions habe ich aus den News entnommen.

 

2021-08-05

Die API-Hilfe ist nun auch verfügbar und ich habe die Listen ergänzt.

 

 

Entfernt

Hinzugefügt

Von |2021-08-05T08:08:41+02:002021-08-04|EPLAN, EPLAN-API, EPLAN-Scripts|

EPLAN Ribbon erstellen

Update 2021-12-04:

Ich habe ein neues Beispiel hier erstellt.


Die Beta zu EPLAN 2022 läuft, und ich bekam schon ein paar Anfragen, ob es möglich ist eigene Ribbons zu erstellen: Ja kann man 🥳

Darum hier mal der Beispielcode:

[DeclareRegister]
public void Action()
{
  RibbonBar ribbonBar = new RibbonBar();
  RibbonTab ribbonTab = ribbonBar.AddTab("Suplanus");
  RibbonCommandGroup ribbonCommandGroup = ribbonTab.AddCommandGroup("MyGroup");
  ribbonCommandGroup.AddCommand("MyButton", "MyAction", CommandIcon.Accumulator);
}
Von |2021-12-04T13:23:50+01:002021-07-15|EPLAN, EPLAN-Scripts|
Nach oben