Create pallet using Flexscript

Create pallet using Flexscript

ashmita_g
Not applicable
1,100 Views
6 Replies
Message 1 of 7

Create pallet using Flexscript

ashmita_g
Not applicable

[ FlexSim 20.1.1 ]

Hi, in this model I am trying to create Pallets and boxes using flexscript but I am not able to get the syntax right.

In the model I have two agvs, meant to deliver specific parts to specific queues as per the global table. My intention is to segregate the tokens (produced in the list "items"), using the agvno assigned to each, place them in pallets and transfer them via the assigned agv.

Can you please provide me with the syntax to create pallets and boxes for the above problem using flexscript.

Also if you can provide a sample model for the above problem statement, it will be highly appreciated. Thank you.

Doubt_PalletCreation.fsm

0 Likes
Accepted solutions (1)
1,101 Views
6 Replies
Replies (6)
Message 2 of 7

joerg_vogel_HsH
Mentor
Mentor

Sometimes you must develop your code alone. There are plenty examples that shows how to fill pallets. Try to find them and then implement it in your model.

0 Likes
Message 3 of 7

joerg_vogel_HsH
Mentor
Mentor
0 Likes
Message 4 of 7

ashmita_g
Not applicable

Hi @Jörg Vogel, thank you for the prompt advice and link. Appreciate it.

Will definitely strive for the same.

I have been through articles which suggested using "create object" activity, and use the insert in front of option. I was able to understand the same. However, my question is regarding the syntax in custom code.

Specifically the line:

Object newPallet = createinstance(library().find("?Pallet"), model());

//using which I intend to create a new pallet

I understand after this, I am required to provide the position (x,y axis) as to where the pallet needs to be created. I have a queue upon which I intend to create the pallet. How do I refer that?

Any link, or example for better understanding or guidance would be of great help as I am still new to flexsim.

Also do correct me if the create instance command is wrong. I followed the syntax of creating processors using custom code.

Thank you.

0 Likes
Message 5 of 7

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

Ok, you create a pallet in the space of model. The coordinates are 0,0,0 for the location.

By command “moveobject” you initiate the entry of the pallet as an item into the queue. There are two other methods possible:

  1. you transport the pallet by a tasksequence through an operator into the queue.
  2. you put the node of the pallet as a subnode into the tree of the queue by the command “transfernodeobj” or dot syntax property ”up”. Then FlexSim won‘t notify the entry of the pallet.
Once an object is in a container like the model or an object like a queue it is in the scope of this object and its coordinates. You change a position by changing property settings of location. Spatial attributes of objects are properties of the flexscript class Vec3.

Sometimes you have to cast a reference into a different class. You do this with ”as”. There is small degree of difference when a method is done to an object or treenode. And sometimes an object must be introduced to a module by creating a reference in this class. Examples are the classes Storage for Warehousing, AGV or Conveyor.

Message 6 of 7

jason_lightfoot_adsk
Autodesk
Autodesk
Why are you trying to do this in code? You're altready using process flow activities and there are many designed for the things you're asking to do in code.
0 Likes
Message 7 of 7

Ben_WilsonADSK
Community Manager
Community Manager

Hi @Ashmita G, was Jörg Vogel's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes