Hi,
I have an initialization table with the value for different attributes of various server atoms. One attribute I would like to set also from that table is the 4DS code of the "entry trigger" attribute.
It is interesting that when I try to set the attribute to a value it works, but when I define a 4ds code in the table it is not recognize.
Should I be escaping the code in an specific way? or is it a matter of type casting?
Thanks for your help.
Injecting code into "entry trigger" from a table
Re: Injecting code into "entry trigger" from a table
Hi,
To get values from a table use:
To get text from a table use ( the 3rd parameter is not always required, but will force ED to return the result as text):
To execute code defined in a table cell, you need to read the content as a text and then execute that string using:
Tip: when you want to define pieces of code in a central location in the model, it could be better to use the atom Function Editor (it's in the Tools part of the library). It allows you to create your own 4Dscript functions that can be called in any trigger in your model.
Regards,
Marlies
To get values from a table use:
Code: Select all
Cell( x,y, refMyTable)
Code: Select all
Cell( x,y, refMyTable, 2)
Code: Select all
Execstring( Cell( x,y, refMyTable, 2))
Regards,
Marlies