Skip to content

Ribbon

Customize ribbon

In EPLAN, it is possible to create your own tabs in the ribbon. But what does this have to do with scripting? A script is actually an extension of the functionality of a button in a ribbon. Predefined commands can be executed in a user-defined tab in the ribbon. These are all actions officially supported by EPLAN, which are also documented in the help. A reference to the help can be found in Chapter 5. These commands are also used in a script. One advantage of the script over the button in the ribbon is that several actions can be executed. You would have to create several buttons in a tab in order to achieve the same result. With so many possibilities, the workspace quickly becomes confusing.

In the following, we want to create a new tab in the ribbon. To do this, right-click on the graphical user interface and select Customize ribbon... from the context menu.

Menüband anpassen

The dialog for customizing the ribbon is now displayed. The checkbox indicates whether the tab is visible or not.

Dialog *Menüband: Anpassen*

In we see the different controls that we can create or customize:

  1. quick access: These actions are always visible.
  2. tabs: You can switch between these tabs.
  3. command group: Individual actions can be grouped together. 4th command: The button is displayed with a display name (required) and an image (optional).
  4. tooltip: Short description of the action (optional)
  5. description: Long description of the action (optional)

Steuerelemente im         |

The search field Find command is also displayed in the ribbon. All commands in the ribbon are searchable in the search.

Suchfeld *„Was möchten Sie tun?"*

We create our own tab at the end of the existing tabs using the New tab button. A command group has also been added automatically, as commands can only be inserted in command groups, not directly in a tab.

Neue Registerkarte erstellen

We use the Edit... button to assign the display name Scripting for the tab. We carry out the same action for the command group and assign the display name Scripts.

image-20250509083450029

All window positions and the ribbon are saved via the so-called workspace. We can create various schemes here. The setting can be found at the top right-hand edge of the EPLAN window Workspace > Edit workspace.

Arbeitsbereich auswählen

Dialog *Arbeitsbereich bearbeiten*

Add commands

The different work areas allow us to adapt the ribbon to our needs depending on the task.

We now want to add three commands to our new command group:

  1. execute script

  2. load script

  3. unload script

These commands can be found in the Further commands (File) category. With the button Add we can insert the commands into the command group. These commands can be found via the EPLAN interface under File > Extras > Interfaces.

image-20250509083621762

Info

Commands depend on the license and module scope. For example, if you do not have the Revision management module, the commands it contains will not be displayed.

Commands with parameters

Now we want to go a bit further and add another command, namely Actions > Insert device in the command group Test.

image-20250509083700117

We assign Insert motor protection switch as the displayed name. Now let's take a closer look at the text field Command line. At first glance, there is a very cryptic text with many characters:

XDLInsertDeviceAction /PartNo:? /PartVariant:1
The command line is divided into two areas:

  • Action name: The action name is always at the beginning without special characters.
  • Parameters: There can be one or more parameters for an action. A parameter specifies a property that describes how the action is to be executed.

Structure of the command line:

ActionName /Parameter-1:Value1 /Parameter-2:Value2 /Parameter-n:Value-n

Info

Attention must be paid to the exact spelling. For parameter values with spaces, the parameter value must be written in quotation marks (" "). The spaces between the parameters must also be strictly adhered to.

  • Action XDLInsertDeviceAction:Behind this text is the function for inserting devices in EPLAN.
  • Parameter-1 /PartNr: This parameter is required for EPLAN, as it must be known which article number is to be inserted.
  • Parameter-2 /PartVariant: The second optional parameter specifies the variant in which the article is inserted (by default, this value is set to "1").

We select an example device, in this case a motor protection switch, from the parts database. In the EPLAN sample database, we find the article number SIE.3RV2011-1EA25-0BA0.

XDLInsertDeviceAction /PartNr:"SIE.3RV2011-1EA25-0BA0" /PartVariant:1

Motorschutzschalter in der Artikeldatenbank

We select the M for the image. For the tooltip, we enter Motor protection switch, and for the description, we select the permissible current range.

*Befehl bearbeiten*

After pressing the command in the ribbon, our set motor protection switch is pinned to the cursor in the graphical editor and can now be placed.

Motorschutzschalter einfügen

If an article number is specified that does not exist, a corresponding message appears.

Artikelnummer nicht gefunden