Duplicate objects (multiprocessor, processor, operator) in code?

Duplicate objects (multiprocessor, processor, operator) in code?

hai_l2
Not applicable
209 Views
7 Replies
Message 1 of 8

Duplicate objects (multiprocessor, processor, operator) in code?

hai_l2
Not applicable

[ FlexSim 20.1.2 ]

Is there a quick way in code to duplicate the existing 3d object and its settings?

I have a default multiprocessor defined that I like to duplicate and relocate during model reset.

0 Likes
Accepted solutions (1)
210 Views
7 Replies
Replies (7)
Message 2 of 8

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You can use the createcopy() command. For example:

Object defaultMultiProcessor = Model.find("MultiProcessor1");
Object newObject = createcopy(defaultMultiProcessor, model());
newObject.location = Vec3(5, 5, 0);


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 8

hai_l2
Not applicable

Thanks for the reply. Does that copy the object and all of its settings?

0 Likes
Message 4 of 8

Matthew_Gillespie
Autodesk
Autodesk

@Hai L2 Yes, it duplicates the object.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 5 of 8

joerg_vogel_HsH
Mentor
Mentor

That works with fixed resources and simple flow items, but any object that inherits coupling nodes get problems with a simple copy command. Module objects like AGV paths, conveyors, some taskexecuters and people module aren’t made for this easy method.

0 Likes
Message 6 of 8

hai_l2
Not applicable

Do you mean the links between objects or other assignments are not copied?

0 Likes
Message 7 of 8

joerg_vogel_HsH
Mentor
Mentor

There are objects that are members of a group in a system. These behave a bit different when it comes to copy them. A processor or a multi processor are simple fixed resource objects. You can copy them. I wrote my comment, just for those who find this question and think the command “createcopy” works always.

0 Likes
Message 8 of 8

mikael_bs
Not applicable

Can duplicating racks this way cause issues with the Storage System?

0 Likes