Get info about a Multilocation using getProperty?

Get info about a Multilocation using getProperty?

clairekruppGhafari
Collaborator Collaborator
156 Views
2 Replies
Message 1 of 3

Get info about a Multilocation using getProperty?

clairekruppGhafari
Collaborator
Collaborator

Hello

 

I have several Multilocations containing floor spots in a museum. I want to get the current number of people in the multilocation and also the maximum number of spots (in this case, the number of sublocations).

 

I have tried various combinations of "multiLocation.getProperty(...) "and "stats.content.value", and they all give me a value of 0, even when that is not true. I tried "stats.totalContent.value" that was mentioned in another question, but that gives me a syntax error. I don't even see anything in the treenode of a multilocation that has this data.

 

How do I get these values?

 

Thanks

 

(version 25.2)

 

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

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

"totalContent" is not implemented as a property of 'object.stats', but such a node exists for multilocation objects to track the total input, output and content. You can access them as a Tracked Variable.

moehlmann_fe_0-1770882853998.png

Object ml = ...;
TrackedVariable totalContent = stats(ml).subnodes["contentTotal"];
int content = totalContent.value;

The number of sublocations is the number of drawsurrogate objects.

Object ml = ...;
int numSubLocations = ml.attrs.drawsurrogate.subnodes.length;

 

0 Likes
Message 3 of 3

clairekruppGhafari
Collaborator
Collaborator

Thanks Felix @FelixMoehlmann . That is just what I needed.

0 Likes