Page 1 of 1

Setting custom properties to "unset"

Posted: Fri Aug 21, 2015 9:39 am
by totebo
Hi,

Is there a way to "unset" custom properties after you have previously set them? My specific issue is setting the color parameter, then clearing it so it has no value. I suppose this would also apply to boolean checkboxes and maybe other custom properties too.

Cheers,

Niclas

Re: Setting custom properties to "unset"

Posted: Sat Aug 22, 2015 4:20 pm
by iforce2d
For numeric and string types you can enter an empty string to unset them.

For color and bool types, you need to use script at the moment.
Example:
getBody('body0').clearCustomProperty('mycolor');

If you search for 'clearCustomProperty' in the built-in help you should find a page with some more details on this that might be helpful.

Re: Setting custom properties to "unset"

Posted: Wed Sep 09, 2015 1:42 pm
by totebo
Great. I get an error, but it clears the color var. The error is:

"Error in ClearCustomPropertyValueCommand"