question

Cameron Pluim avatar image
0 Likes"
Cameron Pluim asked Phil BoBo answered

Can updatelocations() be called on a TE flowitem that is created from process flow?

I'm trying to create a heatmap of where TE flowitems are walking in my model that uses AStar to direct their travel.

I have the following code:

treenodearray pulledTravelers = getlabel(token,"pulledTravelers");


for(int i= 1; i <= arraysize(pulledTravelers); i++) {
	treenode person = getlabel(pulledTravelers[i],"item");
	if(objectexists(person)) {
		updatelocations(person);
		
		int personNum = getlabel(person,"PersonNum");
		addtablerow("HeatMapData");
		int row = gettablerows("HeatMapData");
		settablenum("HeatMapData",row,1,personNum);
		settablenum("HeatMapData",row,2,get(spatialx(person)));
		settablenum("HeatMapData",row,3,get(spatialy(person)));	
	}
}

and every time it gets to updatelocations(person) it throws the following error and exits the code so it never captures the data I want to capture

exception: Exception caught in TreeNode::callMemberFunction() c++/dll execution. Throwing... MAIN:/project/exec/commandlist/updatelocations/node c: MAIN:/project/exec/commandlist/updatelocations/node thisClass: MAIN:/project/exec/commandlist/updatelocations/node exception: Exception caught in flexscript execution of MODEL:/Tools/ProcessFlow/ProcessFlow/Update locations>variables/codeNode line 12 instruction 28. Discontinuing execution. exception: Exception caught in TreeNode::callMemberFunction() flexscript execution MODEL:/Tools/ProcessFlow/ProcessFlow/Update locations>variables/codeNode c: /Tools/ProcessFlow/ProcessFlow/Update locations>variables/codeNode i: /Tools/ProcessFlow/ProcessFlow/Update locations>variables/codeNode theclass: /Tools/ProcessFlow/ProcessFlow/Update locations>variables/codeNode exception: Exception Caught in updatelocations(treenode object) exception: Exception Caught in ObjectFunction225__project_exec_commandlist_updatelocations_node object: MAIN:/project/exec/commandlist/updatelocations/node class: MAIN:/project/exec/commandlist/updatelocations/node

Is there a bug in updatelocations that is making it so I'm unable to call it?

FlexSim 16.2.0
astarheat mapupdate locations
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

Phil BoBo avatar image
0 Likes"
Phil BoBo answered

Yes, updatelocations() has a bug that makes it throw an exception if the TE flowitem is directly under the model. This will be fixed in the next release.

5 |100000

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