question

Omar Aguilera Rico avatar image
0 Likes"
Omar Aguilera Rico asked Matthew Gillespie commented

Referencing an object in code

Hi good day. I'm trying to develop a code but I stopped because I'm looking to apply a code that is used with the dropper, when you select an object, for example model (). Find ("Queue1"), what I'm looking for is that the name Queue1 I I can change it by code to make reference to the model (). find ("x"), and the x = object that is determined by code. How can I do this? Regards!

FlexSim 18.0.2
code c+
· 2
5 |100000

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

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Can you give an example? I'm confused. If x is already an object reference why do you need to use the model.find() method to get a reference to that object?

0 Likes 0 ·
Omar Aguilera Rico avatar image Omar Aguilera Rico Matthew Gillespie ♦♦ commented ·

treenode Objeto = groupmember(SelGrupo,index);

return model().find("Objeto");

It is a silly example but it represents something of what I am looking to achieve.

0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

This is redundant. You already have a reference to the object. Your example would be:

return groupmember(SelGrupo, index);
· 5
5 |100000

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

Omar Aguilera Rico avatar image Omar Aguilera Rico commented ·

I tried to do the following but it marks me error:

treenode Objeto = groupmember(SelGrupo,index);

return Objeto);

Why should I make an error?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Omar Aguilera Rico commented ·

Delete the ")" after Objeto.

0 Likes 0 ·
Omar Aguilera Rico avatar image Omar Aguilera Rico Matthew Gillespie ♦♦ commented ·

Sorry, I wrote it for more.

treenode Objeto = groupmember(SelGrupo,index);

return Objeto;

0 Likes 0 ·
Show more comments
Show more comments