add some general method create_ifc_file()
In a lot of cases I need some ifcfile framework add some product with geometry add it to the spatial structure and write the ifc.
AFAIK there is not ifcfile framework ready to use. For creating nurbs ifc out of a brep I used this script https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/blenderbim/scripts/obj2ifc.py no changes where made to create_ifc_file() My version can be found here: https://github.com/berndhahnebach/IfcOpenShell/blob/03962eb58c3b9e561b4a21d5b7b18675b42d3e05/src/blenderbim/scripts/brep2ifc.py
This file https://github.com/berndhahnebach/IfcOpenShell/blob/brep2ifc/src/blenderbim/scripts/dxf2ifc.py has a similar method create_ifc_file() as well.
How about adding some general method create_ifc_file() which is ready to add products too? For scripting this would be very handy to import such a method from ifcopenshell.
I would even help with this, but have no idea where to put this.
cheers bernd
Comments
Doesn't this already exist? See
ifcopenshell.template
?how do I use this?
ifcopenshell.template.create(...)
Has this been added recently?
I need to update IfcOpenShell ...
It's been there for a while now.
ok my fault ... seams exactly what I need ... :-)
This is what has worked for me. Any review, comments and suggestions will be greatly appreciated.
How about a method to create a minimalisc spatial strucutre in a existing ifcfile object which has no spatial structure?
Or is it like many cases for me ... there is something in IfcOS already, but I just do not know about ...
@bernd sure, I think it's a great idea to add that to ifcopenshell.template (not as part of the create function, but as a separate create_spatial_structure function perhaps).
For sure it has to be a separate method and not a template option. This is useful for exist files as well.
where in ifcos should such method be added?
In the ifcopenshell.template module, I would imagine.
ifcopenshell.template was added before the HL API was provided. I think it maybe also make sense to better integrate them. Maybe both (empty template and basic spatial structure) should be API calls instead. But regardless of which approach, any effort towards making basic setup less tedious is very helpful.