class
ScriptTextListObject.
ScriptTextListMarker
Bases: object
Marker object to check whether an ScriptObject is a textlist object.
3.5.11.0
is_textlist
Gets a value indicating whether this ScriptApplicationMarker is a textlist.
bool
True if it is a textlist; otherwise False.
class
ScriptTextListObject.
ScriptTextListObject
Bases: ScriptTextListObject.ScriptTextListMarker
ScriptObjects which are a textlist object are extended with this interface.
3.5.11.0
addlanguage
language
Adds a new language to the text list.
If the language already exists, it is not added twice.
removelanguage
language
Removes a new language to the text list.
rows
Gets the collection of the rows currently configured within this textlist.
languagecount
Gets the current number of languages in this textlist.
int
getlanguage
index
Returns the language with the given index.
index (int) -- The index of the language to return.
ArgumentOutOfRangeException -- Thrown when the given index is not in the valid range.
str
updatetextids
Only for global textlist.
Calls the command 'Update Visualization Text IDs' for this textlist. This command updates all inconsistent IDs in a static text list.
checkids
Only for global textlist.
Calls the command 'Check Visualization Text IDs' for this textlist. This command checks whether the ID of a text list entry in the project is correct and reports the result.
removeunusedids
Only for global textlist.
Calls the command 'Remove Unused Text List Entries' for this textlist. This command checks whether a text list entry in the project is used as static text. If not, CODESYS removes it from the text list.
importfile
importfile
Like in import/export dialog: The file can contain text list entries both for the global text list and for text lists.
importreplacementfile
importfile
Like in import/export dialog: The replacement file contains replacements for the global text list.
importfile (str) -- Name and path of a file of type csv.
export
exportfile
Like in import/export dialog: exports all the texts from all the text lists in the current project.
class
ScriptTextListObject.
ScriptTextListRow
Bases: object
A row within an ScriptTextListObject.
3.5.11.0
id
The identification of the row.
str
defaulttext
The default text entry in this row.
str
setlanguagetext
language
text
Sets the text in the row, for a defined language.
language (str) -- The languagename, which defines the language entry, to use.
text (str) -- The text to set for this language.
ArgumentOutOfRangeException -- Thrown when the language does not yet exist in the textlist.
bool
True if the text could be set, otherwise False.
setdefaulttext
defaulttext
Sets the defaulttext in this row.
defaulttext (str) -- The defaultext to set for this row.
bool
True if the text could be set, otherwise False.
languagetextcount
Gets the current number of languagetexts in this row.
int
languagetext
index
Gets the languagetext.
index (int) -- The index of the languagetext to return.
ArgumentOutOfRangeException -- Thrown when the given index is not in the valid range.
str
The language text.
class
ScriptTextListObject.
ScriptTextListItemsCollection
Bases: list
The items currently managed by the textlist object.
3.5.11.0
add
id
defaulttext
Adds a new row to the current textlist.
id (str) -- The id to assign to the newly inserted row. Must not yet be existing.
defaulttext (str) -- The default text.
The newly created ScriptTextListRow.
remove
id
Removes the ScriptTextListRow with the given id.
id (str) -- The id of the item to remove.
KeyNotFoundException -- Thrown when no entry with the given id exists.
class
ScriptTextListObject.
ScriptTextListObjectContainer
Bases: object
Projects and Application Objects are extended with this interface.
3.5.11.0
create_textlist
name=None
Creates a new textlist object in the current context (either application or project global).
name (str) -- The name of the new textlist object. In case of None, a default name will be generated.
ArgumentException -- Thrown when a textlist with the given name already exists within the current context.
The newly created textlist object.
get_global_textlist
Returns the global textlist object or creates a new one if not yet existing.
Typically this method can be called on projects only. Only in case of special customizations of the programming system, it is allowed to call this on an application too.
The global textlist.
has_global_textlist
Checks whether there is already a global textlist in the current location.
Only in case of special customizations of the programming system, it is allowed to call this on an application too.
InvalidOperationException -- Thrown when called on applications when this is not allowed.
bool