question

Daniel avatar image
0 Likes"
Daniel asked Jeanette F commented

Why Does a Scripted Conveyor Differ from a Manually Created Conveyor in FlexSim?

I am using the following code to create a conveyor in FlexSim:

treenode conveyorNode = node("/project/library/fixedresources/Conveyor");
newObj = createinstance(conveyorNode, model());

However, the conveyor created using this script looks different from the one created manually (as shown in the attached image). Specifically, the one created manually allows adding elements like Decision Points or Stations, while the scripted version does not.

1736233634807.png

Could anyone explain why this discrepancy exists? Is there an additional step or property initialization required to make the scripted conveyor fully functional and identical to the manually created one?

FlexSim 24.2.1
conveyorflexscript
1736233634807.png (98.7 KiB)
· 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.

Hi @Daniel, was Joerg Vogel's answer helpful? If so, please click the "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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

You have created a legacy conveyor. As you see in its path it is a Fixed Resource.

Conveyors of the conveyor module have got a different path.

"MAIN:/project/library/conveyor/Conveyor"

· 4
5 |100000

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

Daniel avatar image Daniel commented ·

Excuse me,I had change the path that you provide, but the conveyor dosen't show on it. How can I fix it? Thank you so much.

1736493323954.png
0 Likes 0 ·
1736493323954.png (28.6 KiB)
Joerg Vogel avatar image Joerg Vogel Daniel commented ·

Object.create a static Method

Object newConveyor = Object.create("Conveyor::StraightConveyor");

Path:

"MAIN:/project/library/conveyor/StraightConveyor"

0 Likes 0 ·
Daniel avatar image Daniel Joerg Vogel commented ·

Thank you for answering my previous question. I appreciate your help! I have a follow-up question: I tried to add a station to the conveyor using the following Flexscript code:

treenode stationTempNode = node("/project/library/conveyor/Station"); 
treenode stationNode = createinstance(stationTempNode, newObj);

However, the station does not successfully attach to the conveyor. How should I modify my Flexscript code to make it work properly? Thank you again for your assistance!

0 Likes 0 ·
Show more comments