I'm trying to create an object from a family by it's name:
const newObject = runtime.objects["name"].createinstance(<parameters>);
This works, but I wanted to do so using a name stored in a variable:
let objName = "name";
const newObject = runtime.objects[objName].createinstance(<parameters>);
TypeScript won't let me do this because it is afraid "objName" won't be a valid value.
How should I go about this then?
Thanks in advance.
edit:
this works, but I'm not sure how good of a solution it is:
let objName = "name";
const newObject = (runtime.objects as any)[objName].createinstance(<parameters>);