question

Tomi Kosunen avatar image
0 Likes"
Tomi Kosunen asked Jason Lightfoot edited

GIS Point OnDraw trigger

How can I add OnDrawTrigger to a Point on the GIS map? I'm creating the points on the fly so trigger has to be created from FlexScript. Pls see the attachment where I create the OnDraw trigger (Point2) but it doesn't do anything.

GISPointOnDraw.fsm

FlexSim 23.2.0
gis ondraw flexscript
gispointondraw.fsm (26.7 KiB)
· 2
5 |100000

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

Tomi Kosunen avatar image Tomi Kosunen commented ·
Now I noticed, that the trigger works if the model is reloaded into FlexSim (save-exit-read) after the trigger setting. That doesn't help me as I delete all the points and re-create at the beginning of the simulation.

You can delete the Point2 and then run the script. You'll see that the OnDraw trigger is not "active"

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Tomi Kosunen commented ·
You script doesn't create Point2 so complains with an exception when you run it.
0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

Add :

rebindobjectattributes(pt_node);

I would assert the subnode rather than create it explicitly.

treenode triggernode = pt_variables_node.subnodes.assert("ondrawtrigger","");

I don't think you need enablecode();

5 |100000

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