Thx
BTW tried recompute on all beams… different, but not desired result
BTW 2
Is there a way to define objects in general, in this case Structure/ifcBeam so that it will export to ifc4 with quantities From FreeCAD?
Imported to BlenderBIM, looks correct, but no base QTY.
When ticking the boxes in BlenderBIM, we get ‘guess’ the above data
Importing structure_ifcexport_problem_01.ifc in BimSync, no Base QTY show up
If applying Base Qty in BlenderBIM, then exporting, they will
>>> f = ifcopenshell.open('/home/dion/drive/bim/DhFundament.ifc')
>>> for e in f.by_type('IfcElement'):
... e.GlobalId = ifcopenshell.guid.new()
>>> f.write('/home/dion/drive/bim/DhFundament2.ifc')
Maybe we should implement this, avoiding duplicate GUID’s
Regards
export the structure to ifc (the IfcData property will get a IfcUID)
use Edit → duplicate selection to create a copy → this copy will have the same id in IfcUID
thus on export both objects have the same uuid.
This should normally not fixed in export. The copy method should return an unique id already. But this is rather difficault, since there are dozens of tools which copy in FreeCAD. Thus we need to takle this on ifc export.
Most import is FreeCAD should write ifc files with unique uuids.
However, it seems that the ‘Global’ uniqueness needs to hold only on the document level, in which case the best bet would probably be to deteministically hash a known document-unique identfier, e.g. the previously suggested object “FullName”.
The advantage would be that the resulting 128-bit number would stay the same not only during document editing, but after load/save cycles on different computers. But would it actually be an advantage or disadvantage, that depends on what the ‘Global’ uniqueness should mean in this case.
if not uid:
hash_for_uid = hashlib.blake2b(digest_size = 16)
hash_for_uid.update(obj.FullName.encode("ascii"))
uid = ifcopenshell.guid.compress(hash_for_uid.hexdigest())
# storing the uid for further use
if preferences['STORE_UID'] and hasattr(obj,"IfcData"):
d = obj.IfcData
d["IfcUID"] = uid
obj.IfcData = d
return uid
or something similar. Totally untested, as I don’t have ifcopenshell installed on this computer. Also, there should not be the if not uid: conditional, I think, because there would be a need to update the uid for any copied object. So, that logic needs to change, too.