question

Jay Khedekar avatar image
0 Likes"
Jay Khedekar asked Jay Khedekar commented

How to add trigger to 3D object created with flexscript?

I am creating a list of 3D object Queue with flexscript using createinstance() function. For each of it I want to set trigger on enter and exit while I create them to avoid adding them later manually. How can I achieve it?

FlexSim 23.0.15
flexscripttriggerautobuild
· 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

Arun Kr avatar image
1 Like"
Arun Kr answered Jay Khedekar commented

Use setproperty() to add triggers by code. This will work in future versions also.

  1. Object Queue =Model.find("Queue1");
  2. string y ="Object current = param(1);";//code as string
  3. Queue.setProperty("Triggers.OnEntry",y);
· 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.