Setting custom properties to "unset"

Report problems here (or use the built-in feedback dialog in the editor)
Post Reply
totebo
Posts: 5
Joined: Sat Jul 19, 2014 9:14 am

Setting custom properties to "unset"

Post by totebo » Fri Aug 21, 2015 9:39 am

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

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Setting custom properties to "unset"

Post by iforce2d » Sat Aug 22, 2015 4:20 pm

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.

totebo
Posts: 5
Joined: Sat Jul 19, 2014 9:14 am

Re: Setting custom properties to "unset"

Post by totebo » Wed Sep 09, 2015 1:42 pm

Great. I get an error, but it clears the color var. The error is:

"Error in ClearCustomPropertyValueCommand"

Post Reply