question

Kyle OB avatar image
0 Likes"
Kyle OB asked Ben Wilson commented

Create copies of custom object and acquire them as a resource?

TaskExecuter Sim Tool - Posted.fsm

I've created a custom task executer object with conveyors that are attached to the top of this object (shown in the 3D model and copied into a folder under "Tools/MyObjects/Single_TCar"). I'm using custom code in the process flow to make copies and add them to a group, so I can reference the group as a resource and acquire them to execute tasks.

The main line of code I'm using is:

" treenode newTCar = createcopy(Model.find("Tools/MyObjects/Single_TCar").model()); "

This code references a subfolder I made called "MyObjects" under the Tools folder. When the model runs it creates a copy, then pauses, and when I hit reset, the object I created appears in "MyObjects" subfolder instead of the model as I have specified it to be created in. The treenode syntax seems to be the issue. The model doesn't seem to know where the created objects are since it stops and it never acquires the new object in the that step of the process flow.

FlexSim 20.2.2
flexsim 20.2.2user librarytreenodecreatecopy
· 1
5 |100000

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

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Kyle OB, was jason.lightfoot's answer helpful? If so, please click the red "Accept" button on 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 0 ·

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered

Clear the resetposition variable flag in the template object.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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