Using Object property fields in Structured Text

<< Click to Display Table of Contents >>

Navigation:  Project > Scripts > ST language >

Using Object property fields in Structured Text

Previous pageReturn to chapter overviewNext page

You can include Object property fields in your project’s scripts by using keyword Objects. Then type dot (.), name of your Object (for object type you can use keyword - this), again type dot (.) and name of property field. For possibility to compile this code the name of the object and object property fields should contain only English letters without white spaces and any signs.

Example:

int width = 100;

Objects.Rectangle.width = var;

In this example value of the variable var will be assigned to Object with name Rectangle and field property name width. Name of the property fields you can find out in parentheses of object and property descriptions above.

Other Example:

Objects.this.fillcolor=“0x66AA00FF”;

Change color of the current object to which the script is attached. Color is represented in RGBA format. Where:

0x  - Hex format of the color.

66  - Red color;

AA - Green color;

00  - Blue color;

FF  - Transparency.

Also it’s possible to use standard colours by using keyword Color.

Example:

Objects.Button.fillcolor=Color.BLUE;

 

List of colours:

 

Color

Code

Color.RED

“0xFF0000FF”

Color.BROWN

“0xA52A2AFF"

Color.GREEN

"0x00FF00FF"

Color.BLUEVIOLET

“0x8A2BE2FF"

Color.BLUE

"0x0000FFFF"

Color.CORAL

“0xFF7F50FF"

Color.AQUA

“0x00FFFFFF"

Color.CYAN

“0x00FFFFFF"

Color.AQUAMARINE

"0x7FFFD4FF"

Color.DARKBLUE

“0x00008BFF"

Color.AZURE

“0xF0FFFFFF"

Color.DARKCYAN

“0x008B8BFF"

Color.BLACK

“0x000000FF”

Color.DARKGREY

“0xA9A9A9FF"

Color.DARKGREEN

“0x006400FF"

Color.DARKORANGE

“0xFF8C00FF"

Color.DARKRED

“0x8B0000FF"

Color.DARKVIOLET

“0x9400D3FF"

Color.GOLD

“0xFFD700FF"

Color.GREY

“0x808080FF"

Color.INDIGO

“0x4B0082FF"

Color.IVORY

“0xFFFFF0FF"

Color.KHAKI

“0xF0E68CFF"

Color.LIGHTBLUE

“0xADD8E6FF"

Color.LIGHTCORAL

“0xF08080FF"

Color.LIGHTCYAN

“0xE0FFFFFF"

Color.LIGHTGREEN

“0x90EE90FF"

Color.LIGHTGREY

“0xD3D3D3FF"

Color.MAROON

“0x800000FF"

Color.NAVY

“0x000080FF"

Color.OLIVE

“0x808000FF"

Color.ORANGE

“0xFFA500FF"

Color.PINK

“0xFFC0CBFF"

Color.PURPLE

“0x800080FF"

Color.SILVER

“0xC0C0C0FF"

Color.VIOLET

“0xEE82EEFF"

Color.WHEAT

“0xF5DEB3FF"

Color.WHITE

“0xFFFFFFFF"

Color.YELLOW

“0xFFFF00FF”