For example, I got two ifc files, one named A and the other named B. Now I'd like to copy a certain element(like a beam) from A to B, so that the beam can be shown in the model B when file B is opened with ifc viewer.
What I have tried is to extract the related geometry entities of IFCBEAM(like IFCTRIANGULATEDFACESSET, IFCPRODUCTDEFINITIONSHAPE) from A, then paste them to B. But it failed.
Is there any other ideas, methods or functions in IfcOpenShell which can make it?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For example, I got two ifc files, one named A and the other named B. Now I'd like to copy a certain element(like a beam) from A to B, so that the beam can be shown in the model B when file B is opened with ifc viewer.
What I have tried is to extract the related geometry entities of IFCBEAM(like IFCTRIANGULATEDFACESSET, IFCPRODUCTDEFINITIONSHAPE) from A, then paste them to B. But it failed.
Is there any other ideas, methods or functions in IfcOpenShell which can make it?
Thanks.
Have a look at ifcopenshell.file.add() which can recursively copy from one file to the other. There is also the high level api https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py