question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Jason Lightfoot commented

How to find objects with code?

Hi Team,

I have 100+ objects in my model. Code is written under few objects using event triggers. Currently, whenever I open the model, I have to check each object 1 by 1 to check where code is written until I find them.

I would like to know if there is any way through which we can directly find the objects where code is written?

Thank you!

FlexSim 23.0.0
codetriggerobjectsfind
5 |100000

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

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

Open a tree view and use the Search panel to look for the text you want. In the search results you can double click an entry to open it. The path shows on which objects the code is located.

1679572407094.png

But - if you have repeated code then you should be using templates to manage your code and then you just need to edit /inspect the template master and not all the instances of that template. Alternatively you can use usercommands to centralize and organize your code.


1679572407094.png (25.0 KiB)
· 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.

Ankur A3 avatar image Ankur A3 commented ·

Hi @Jason Lightfoot ,

Your answer is helpful. But it depends on the right text. Even using it, we can't find all the objects at single place where coding is done.

What do you mean by using template? Can you show me the small model how to use this feature?

Thank you!

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Ankur A3 commented ·

Template_EntryTrigger.fsm

In the model there is a master processor (blue) with an entry trigger. All the other processors are instances of the template and inherit from the master. The entry triggers are all in italics to show this, apart from the red processor which has had a change to the entry trigger and so it shown as bold.

1679583543871.png

Manual section on Templates here.

0 Likes 0 ·
Ankur A3 avatar image Ankur A3 Jason Lightfoot ♦ commented ·
Hi @Jason Lightfoot,

I really appreciate your response on sharing the example with model.

Can you also share the model with an example model showing the use of user commands and centralizing the logic as you mentioned in first reply?

Thank you!


0 Likes 0 ·
Show more comments

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.