Property validation

Hi,

when creating custom properties, is it possible to enable validation of property values like it is done in the Name property of e.g. bae frames (“Name must be unique…”)?

As an example, i would like to add a property to each routine of a robot and the values must be unique within the scope of the robot.

Kind regards,

Adrian

You would need to implement your own code that tracks creation and deletion of those IProperty objects and registers listeners for the value change event of each property. Then in the value change event handler you can do your own validation checks and show such an error message.

I hope this is not coming too late. When you create a property without setting a name, the property name is always unique. For example.

app.World.Components.First();
var block_length = comp.CreateProperty(typeof(double), PropertyConstraintType.NotSpecified);

The api does the unique name validation for you.