question

Steven Chen avatar image
0 Likes"
Steven Chen asked Steven Chen commented

Call functions on context menu by using script

Hello,

I am working on custom module and I want to know which function called on clicking Module->[Custom Module]->Add as Replacement. I guess it will be something like applicationcommand("commandname") with some code to indicate the module.

I plan to using the function to replace lots of nodes by using script instead of using my right hand and mouse.

FlexSim 19.1.2
module
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

Mischa Spelt avatar image
0 Likes"
Mischa Spelt answered Steven Chen commented

I've never tried to do this using code, so I'm not sure how to emulate clicking the "Add as replacement" option.

In general I try to avoid replacing standard FlexSim nodes in modules, as it may lead to issues when a new FlexSim release updates those nodes.

But very occasionally it may be what you need. In that case, an alternative approach could be creating the replacement node directly under your module's install data (MAIN:/project/modules/.../installdata):


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

Steven Chen avatar image Steven Chen commented ·

Well, I did try to create replacement node under install data on my own, but it looked like I still miss something to make it work.

I found there was a mistake in my script. So yes, build everything under install data is good as I expected.

Thank you.

0 Likes 0 ·