It can often be very convenient to define your own custom properties on shapes (or images/text). Once defined, these properties are used and modified just like any predefined shape property.

Custom properties are defined on shapes (or images/text) using the normal mechanism for defining a variable: define .

Custom properties with quick shape creations

When using the one line object creation, just include your custom variable in the list of variables:

Here, we’re adding a custom property numberOfObjects to each shape using the define numberOfObjects=10 codes on each line.

Custom properties with types

With the type/template based approach it is also easy to define our own custom properties on the shape, that we can then use in our codes just like the predefined properties. (You can do this with the other 1-line approach, but there’s more risk of making a typo). Just like when defining a normal variable, we need to use the define keyword:

In the above code we have modified our shape type to include a custom property alreadySelected that we can use anywhere in our code. Then we create an empty collection, and create 10 shapes, adding each shape to our collection. We could then use these shapes in different ways, but each shape has its own alreadySelected property associated with it.