getControlBasePath

[ Funktion ]

public static getControlBasePath(
    type: string
): string | null;

Gibt den Basispfad eines Controls basierend auf dem Control-Typ-Namen zurück. Dieser wird zum Beispiel benötigt, wenn Sie auf das Verzeichnis eines Controls zugreifen möchten.

Parameter

Name

Typ

Beschreibung

type

string

Control-Typ-Name

z.B.: TcHmi.Controls.Beckhoff.TcHmiButton

Rückgabewert

Typ

Beschreibung

string | null

Basispfad des Controls oder null falls der Typ nicht bekannt ist.

getControlBasePath 1:

Verfügbar ab Version 1.12

Beispiel - JavaScript

var fullImagePath = TcHmi.Environment.getControlBasePath('TcHmi.Controls.MyNamespace.MyControl') + '/images/myImg.png';