fillSvgElement()

Modifies the SVG image used for filling a shape.

Synopsis

shape.fillSvgElement(string element, string fill, string color);

Parameters

Parameter Description
element ID of the SVG element to adjust.
fill Fill type string, for example solid.
color Color to use. Relevant only for fill types that use a color (solid and hatch). For other types, use an empty string.

Details

The fillable primitive shape object needs to have an SVG already loaded. You can either set it as fill attribute or define it in the panel in GEDI.

The element inside this SVG is then adjusted to use the given fill string (for example "[solid]") and the given color for this fill type. The color is only relevant for fill types which use the color (solid and hatch). For others it can be given as an empty string.

Note:
Inside the Script Editor the SVG element can be selected with the SVG-Element Selector from the tools menu. The elements shown here are only elements the script editor can already address (i.e. the ID for the specific shape elements is available) and that already have a defined SVG fill pattern set statically via the Attribute Editor. Text elements cannot be addressed. If no element is available, any SVG file can be inspected via the file selector.
Note:
To revert the SVG element to its original fill style, pass empty strings for both fill and color, for example: RECT.fillSvgElement("elem", "", "");

The given fill-string and color adhere to the current colorScheme and the active IconTheme and will also switch when these change in runtime. Blinking colors are supported as well.

Restriction:
When the function is used for a button object, the usage of dynamic colors is not supported!

Assignment

Button, Polygon, Arc, Ellipse, Rectangle