question

Manuel Sinco avatar image
0 Likes"
Manuel Sinco asked tannerp commented

Command to craete a fixed Resource as pick and drop

Hello, I want to know which command will allow me to create an object into the Model as I pick and drop a source, combiner, etc. from the library.

Previously, I used the command createcopy based on that I had a Dummy Fixed Resource and then I copied it and change its labels, but this way generates me some errors with process Flow, instead of when I create them directly from the library, so I want to which is the command that creates them.

Thanks.

Manuel.

FlexSim 19.1.0
flexsim 19.1.0
· 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.

tannerp avatar image tannerp commented ·

Hi @Manuel Sinco, was Jörg Vogel's answer helpful? If so, please click the red "Accept" button on their answer. If not, feel free to comment back with more information and we'll provide further support. Thanks!

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel edited

The create object activity is exactly the right approach to do that. There isn”t a command that replaces drag and drop from library. If you want to build a new object behavior by this approach, you will run into trouble, because there are some functions, that needs to be reset before they are going to work.

The main procedure is by:

  • Create Object activity > choose an Object from Library and place it in model().

assign created object to a label at token, e.g. myNewObj

  • Source Code activity > set a unique name, e.g. by appending a rising number
token.myNewObj.name = “mySetName”+string.fromNum(10);
  • Change Visual activity > sets a location
  • Assign Labels activity > sets labels at token.myNewObj
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.