question

Kevin A2 avatar image
0 Likes"
Kevin A2 asked Phil BoBo answered

Question on module

After developed a module, when I open FlexSim (before opening a model), the compiler console shows some Flexscript errors. This is because in an edited node of my module I referred to some objects of a model, which FlexSim sees them as "Undefined" when I am not opening the model. Is there a way to make FlexSim not to "read" the module until I open a model, so that these errors won't pop out when I first open FlexSim?

And here is an unrelated question: I want to clear up the output console everytime I press the reset model button, how can I do that? Thank you very much.

FlexSim 17.2.5
module sdkmodules
· 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.

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered

Don't reference model objects from a module. Modules customize the application. They aren't model-specific. If you want to read a value from within a model, you need to assert it with a default value. You can't assume that the object is there.

In the toolbox, add Modeling Logic > Model Trigger > On Reset with the following code to clear the output console:

  1. clearconsole();
5 |100000

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