question

Arun Kr avatar image
0 Likes"
Arun Kr asked Joerg Vogel edited

How to add a tracked variable label using code?

Hi,

Is it possible to add a tracked variable label to an object using code?

Regards,

Arun KR

FlexSim 17.2.2
tracked variable
5 |100000

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

1 Answer

Arun Kr avatar image
1 Like"
Arun Kr answered Joerg Vogel edited

Hi,

I managed to do it. The code is given below.

Object Queue = model().find("Queue1");//Object in which the tracked variable is made
treenode tv = labels(Queue).subnodes.add();
tv.name = "Model";
TrackedVariable.init(tv, STAT_TYPE_LEVEL, 0);

Regards,

Arun KR

· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
treenode tv = Queue.labels.assert("Model");// alternative dot syntax
1 Like 1 ·