question

Yash Patel avatar image
0 Likes"
Yash Patel asked Yash Patel commented

Copying the 3D objects, their connections lables and properties with flexscript.

car-lot-pf - driver - Overflaow Lanes_1.fsmHi I am working on a model where I need to make 100 set of objects they are always connected in same way.

1 common q connected to 100 combiners on 1st in put port and each combiner having their separate floor storage connected to 2nd input port. I could do this by copy and pasting everything multiple time but it will requirement to make new connections an I can miss. Is there a way to use flexscrip to do this for me?

FlexSim 24.2.1
flexscript
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Yash Patel commented

If you copy the entire system as one (hold down shift and draw a box around it to select all objects, then click on an copy any of the selected objects) the connections should also be copied.

1729663727601.png

What I would recommend is that you move all of the objects into a plane. Have all objects selected as above and use the "Edit Selected Objects" window to move them into a plane.

1729664932783.png

Then use the plane as a template. This has the added benefit that any changes made to the original will be copied to the instances, making any future changes much faster than having to edit all sets individually.

1729665286872.png

car-lot-pf-driver-overflaow-lanes-2.fsm


· 3
5 |100000

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

Yash Patel avatar image Yash Patel commented ·
This make copy of sources and sinks as well, what I wanted was just to make more copies for floor storage and combiners and connect them to existing source and sinks. Is there a way to to do that? Along with connections of course. That's why I was wondering if we could just write code to copy and put down more floor storages and combiner.
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Yash Patel commented ·

I think there was a way to do that with templates but it eludes me right now. So here's an alternative approach. I used the parameter option to copy group members and added a couple of lines of code to the On Set trigger to also make the connections to Queue1 and Sink1.

car-lot-pf-driver-overflaow-lanes-3.fsm

1 Like 1 ·
Yash Patel avatar image Yash Patel Felix Möhlmann commented ·
Thanks! This works. I also tried looking into template but seems like I cant find the way to get proper connections as I want.
0 Likes 0 ·