Hi folks,
I'm having a bit of a problem when using the moveobject() command to move a flow item onto a queue. I have a list of flow items and would like to place them into their respective locations (queues). However, when I use the moveobject() command, the item is not placed onto the surface of its corresponding queue but it looks like the following photo
And it even looks weirder when I tried to move the item to the queues on the upper level, the item will have a large offset with the queue surface, like in this photo
Is there any way I can fix this? Thanks a lot for your help.
Here's the code I used to make this:
Table Init = Table("coil_file"); //list of items need to be generated int nrow = Init.numRows; treenode coil = Model.find("/Tools/FlowItemBin/Cylinder/1"); for (int index = 1; index <= nrow; index++) { string location = Init[index]["location"]; //location where the item is placed string coil_num = Init[index]["coil_number"]; int width = Init[index]["width"]; //dimension of the item from the list int diameter = Init[index]["diameter"]; Object newitem = coil.copy(model(), 0); newitem.labels.assert("Coil_number").value = coil_num; newitem.setSize(diameter/1000,diameter/1000,width/1000); //set item's dimensions Object dest = Model.find(location); moveobject(newitem, dest); }