Hello.
I am trying to assign various elements to an element assembly. My function call looks like this:
ifcopenshell.api.run("aggregate.assign_object", model, relating_object=Rost, products=elements),
where Rost is an instance of IfcElementAssembly and elements is a list of the elements i would like to bundle into the assembly.
It yields the following error: TypeError: Usecase.init() got an unexpected keyword argument 'products'
First, I am a bit confused as in the source code the argument products is included:
def assign_object(
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
relating_object: ifcopenshell.entity_instance,
)
Can anyone help me spot the mistake?
Second, while I'm at it, I'm also a bit confused as to what the correct usage of the API is. I've seen the syntax used above with api.run("aggregate.assign_object", ...) as well as api.aggregate.assign_object(...). Considering the source code, the latter seems correct to me but I always get a "module is not callable" error.
What is the correct way to use the API?
Thanks in advance