So we have this script which can create from one obj file an ifc file.
I did a little modification, so this script load several obj file from a directory.
Here the modified script.
and here four example cubus.obj files in a directory. The four cubus have different location.
The main function that i added to the script:
def load_several_obj_files(self):
p = Path(self.path_to_dir)
list_of_obj_files = list(p.glob("*.obj"))
print(list_of_obj_files)
for obj_file in list_of_obj_files:
self.mesh_set.load_new_mesh(str(obj_file))
Unfortunately i got a error, when i tried out :(
Here the error Message:
Traceback (most recent call last):
File "C:\Users\Martin\objstoifc_meshlab.py", line 145, in <module>
obj2ifc.execute()
File "C:\Users\Martin\objstoifc_meshlab.py", line 83, in execute
product = self.file.create_entity(
File "C:\Users\Martin\miniforge\miniforge\envs\pyifc\lib\site-packages\ifcopenshell\file.py", line 276, in create_entity
e[idx] = arg
File "C:\Users\Martin\miniforge\miniforge\envs\pyifc\lib\site-packages\ifcopenshell\entity_instance.py", line 196, in __setitem__
self.method_list[idx](self.wrapped_data, idx, entity_instance.unwrap_value(value))
File "C:\Users\Martin\miniforge\miniforge\envs\pyifc\lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 4867, in setArgumentAsEntityInstance
return _ifcopenshell_wrapper.entity_instance_setArgumentAsEntityInstance(self, i, v)
RuntimeError: An unknown error occurred
Does someone has a solution? In this particular case, how to create from four cubus obj files one ifc file.