I started getting the following error:
FlexScript exception: Invalid variant type used with [] array operator at MODEL:/Tools/FlowItemBin>packing/PartPackingMethod c: MODEL:/StraightConveyor1/Product i: MODEL:/StraightConveyor1/Product/M1_FloorFrame_A1
This was caused because the array was not found in the 'PartLocMap' label of the flow item.
So I wrote the following script to override the 'PartLocMap' of every flow item out there when all the flow items were stored in "YARD". It works perfectly fine but when I would hit "Reset", everything goes back to what it originally said in the FlowItem Bin. This
The code i wrote:
treenode yard = Model.find("YARD"); var xyz = yard.subnodes.length; Map partLocMap; Array yard_storage_subnodes_arr = yard.subnodes.toArray(); //print(xyz); for (int i=1; i <= yard.subnodes.length ; i++) { Object Interested_Part = yard_storage_subnodes_arr[i].subnodes[1]; //gets Floor Frame part's partID. print(Interested_Part); partLocMap[Interested_Part.partID]=[Interested_Part.location,Interested_Part.rotation,Interested_Part.size]; } for (int i=1; i <= yard.subnodes.length ; i++) { yard.subnodes[i].partLocMap=partLocMap.clone(); } ChampionHomes_V8_12.fsm