question

Jon Abbott avatar image
0 Likes"
Jon Abbott asked api answered

How to delete all labels on a token using FlexScript?

I'm trying to delete all labels on a token using FlexScript. I've tried this example but it didn't seem to work. Is there another way to delete all labels on a token using FlexScript? Thanks in advance for your help.

FlexSim 20.0.5
labelstokenflexsim 20.0.5delete
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

Create Token activity to get a new token, then you send the token with all labels simply into a sink activity.

0 Likes 0 ·
Jon Abbott avatar image Jon Abbott Joerg Vogel commented ·

Thanks @Jörg. So is there no way to do this using FlexScript? I can remove one token label using FlexScript with no problem, but removing all labels at once seems to not work for me.

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jon Abbott commented
token.as(treenode).subnodes["labels"].subnodes.clear();
This works for a custom code.
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jon Abbott avatar image Jon Abbott commented ·

Thank you @Jörg, this works. I was hoping it would be as simple as

token.labels.destroy();

or

token.labels.clear();

But your code still works nicely. :^) Thanks again.

0 Likes 0 ·
api avatar image
0 Likes"
api answered
Closing outdated question
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.