Deleting all labels on a 3d object using code in process flow

Deleting all labels on a 3d object using code in process flow

Kashif_AHMAD376CH
Participant Participant
115 Views
2 Replies
Message 1 of 3

Deleting all labels on a 3d object using code in process flow

Kashif_AHMAD376CH
Participant
Participant

Hello,

I often use this code in process flow to delete all labels on a token:

 

token.as(treenode).subnodes["labels"].subnodes.clear();

 

I am trying to use it to delete all labels on a 3d item which is itself a label on the token but it does not work.

 

token.item.as(treenode).subnodes["labels"].subnodes.clear();

 

Is there a way to delete all labels on it easily instead of using Remove label option in assign label activity for each labels?

0 Likes
Accepted solutions (1)
116 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

Labels on objects (and any other properties) are part of the objects attribute tree. 

moehlmann_fe_0-1755497392060.png

You can access the "labels" node under which the labels are stored (and thus delete the label nodes) the following way.

labels(token.item).subnodes.clear();

 

Message 3 of 3

Kashif_AHMAD376CH
Participant
Participant

Thank you. This worked!

0 Likes