question

Ryosuke S avatar image
0 Likes"
Ryosuke S asked Phil BoBo commented

How can I insert 3D Object to the 3D view using FlexScript?

Hello, I would like to insert 3D object such as queue , processors, etc. from the library to the 3D view by FlexScript. How can I do that? I can't seem to find commands such as create or load in the FlexScript reference.

The purpose I want to do this is to automate the insert of the 3D object if the customer has the list of equipment in Excel or csv.

Thank you in advance,

FlexSim 19.0.9
flexscriptflexsim 19.0.9
5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Phil BoBo commented
· 6
5 |100000

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

Ryosuke S avatar image Ryosuke S commented ·
@Jörg Vogel Thank you! Also thank you for the dragconnection. I also needed that.
0 Likes 0 ·
Patrick Cloutier avatar image Patrick Cloutier commented ·

Hello, When I try to create boxes in this fashion:

createinstance(library().find("?Box"), model());

or with this:

createinstance(library().find("Tools/FlowItemBin/Box"), model());

I get a variable/codenode error. But if I put ?Queue or other objects instead of a flowitem all works fine. Is that normal?

It works if I do it with the ProcessFlow activity "Create Object" but I'd need to do it in code for various reasons.

You can see the problem in the attached 1-line model.

1linemodel.fsm

0 Likes 0 ·
1linemodel.fsm (26.7 KiB)
Show more comments
Allister Wilson avatar image
2 Likes"
Allister Wilson answered Ryosuke S commented

You can use createinstance to instantiate library objects, and createcopy if you want to create copies of an object you have already preconfigured.

createinstance documentation

createcopy documentation

· 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.

Ryosuke S avatar image Ryosuke S commented ·

@Allister Wilson Thank you for your reply! I also wanted to give best answer to you but Jörg replied just one minute earlier than you did.

0 Likes 0 ·