question

Hao Zhou avatar image
0 Likes"
Hao Zhou asked Ben Wilson edited

How to use new FlexScript in SDK

Is there a way of using new FlexScript with dot syntax in SDK environment? Or only the old FlexScripts are supported in SDK? I tried to call e.g. model().find("abc") in a C++ function. It does not work well.

Thanks, Hao

FlexSim 17.0.3
module sdk
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

·
Matt Long avatar image
2 Likes"
Matt Long answered Ben Wilson edited

We made the decision to use dot syntax as opposed to C++'s standard -> syntax in flexscript because it's faster/easier to write and more standard throughout other programming languages. Because of that, you can no longer simply switch from flexscript code to C++ code without the need to alter it.

The syntax in C++ for the find command would be:

model()->find("abc")

For getting the content of an object you would say:

object->subnodes.length

You should be able to use all of the new API calls with -> as opposed to dot syntax.

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.