Daniel R13 avatar image
Daniel R13 asked Matthew Gillespie answered

Manual FlexSim Compilation

Hi FlexSim Community!

I am adding some custom code in some of the arrival properties and I am having some issues. Essentially what I am trying to do is to have one of the passengers become extremely visible either by having an icon over there head or having some eye catching features that users watching the model could notice that person is different from the others. I got the changepersonvisuals function working before by turning their shirts and pants a different color but it seems to not run the new code I added. If there is any way of manually compiling it or a better way to indicate specific passengers please let me know. Thanks!


FlexSim 21.1.3
flexscriptcustom codevisualcompilepassengers
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @Daniel R13,

In your arrivals code and/or process flow, how are you determining which person is the special/different one? If it's by using labels or similar features, you could simply have a Decide activity in your Arrivals logic that watches for that label and changes the visuals of only that person. Otherwise, I'm not sure how you would enable FlexSim to distinguish between this different person and the others. I think using labels and a Decide activity would probably be the simplest way to go about this.

I hope this helps! Let us know if you have additional questions!

0 Likes 0 ·
Daniel R13 avatar image Daniel R13 Ryan Clark commented ·

I am determining which person is special with a random number generator. Based on the value I get I change their appearance. I am distinguishing between them by adding them to a group.

Still looking on how to manually compile FlexSim to be direct or have a way to make them visually different in the model itself, changing clothes or other features.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·
@Daniel R13 We don't know what you mean by manually compiling. Also what is the new code you added that isn't working? Please include the code you are trying or attach a sample model so we can see what you are doing.
0 Likes 0 ·
Daniel R13 avatar image Daniel R13 Matthew Gillespie ♦♦ commented ·
Hi Matthew,

Unfortunately I cannot upload the code due to company policy. Essentially I am in the arrivals tab and I look at the FlexScript code that was generated their based off of the model that was created. What I am essentially doing is adding some code in a specific block of the arrivals, for example when a person is created, and save it. Then when I click the play button I get a popup window that says "Are you sure you want to run the model without compiling?"


0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
Matthew Gillespie answered

Are you getting a message like this?

That means there's a a node toggled as C++ in your model.

If you open the System Console and then execute the following script, it will print a list of all the nodes in your model that are toggled as C++:

  1. applicationcommand("findallcodenodes", model(), 0, 1);

You can then find those nodes in your model and change them to not be C++.

Once you have no C++ nodes in your model, reset and run. The message will appear again. Press OK that you wish to proceed anyway. This will clear the variables that are tracking whether there are C++ nodes in your model. The next time you reset and run, that message will not appear and it will no longer appear when you save and reload the model if you successfully changed all the C++-toggled nodes to not be toggled as C++ anymore.

See for more information.

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.