Skip to content

Validity of CadnaA-Lua-Objects

When creating a reference to a CadnaA object in CadnaA-Lua

local x = cna.tables.auxiliary_polygon:first_by_id("a")

make sure that the object is valid when being used. As a rule of thumb it can be said that the references are valid as long as they are existing in CadnaA (this means, until the script has finished execution).

However, when loading new CadnaA project files with cna.load_file(...) - for example - the validity of the references is not guaranteed. Therefore do not use old references to objects after calling cna.load_file(...).

However, native Lua objects, such as plain numbers, strings, file handles, etc. are not affected by this.