IFC exported with FreeCAD. Test in lots of viewer, all do well except BlenerBIM. See https://forum.freecadweb.org/viewtopic.php?f=39&t=49689#p426689
IFC exported with FreeCAD. Test in lots of viewer, all do well except BlenerBIM. See https://forum.freecadweb.org/viewtopic.php?f=39&t=49689#p426689
@bernd the BlenderBIM Add-on is correct, I believe. The IFC file has duplicate GlobalIds - clearly other IFC viewers (including the web based IfcConvert) are lenient. Perhaps a bug in FreeCAD?
This will fix it:
>>> 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')
@moult, @bernd
Thx for investigations.
I think it would be great if BlenderBIM Add-on also can be lenient, and offer a report of errors and warnings.
@duncan for some things, the BlenderBIM Add-on is lenient - the validate tool will also produce a report of errors and warnings. This is not one of those cases, unfortunately. When building an authoring tool - the GlobalId is an indicator of whether or not an element already exists - needed for the ability to "refresh / reload" an existing model. This is not required in a pure viewer, which can just re-display with minimal computing expense. This is why it is strict here.
Thanks for the very fast debuging.
Yeah bug in FreeCAD. On first export of an object to ifc it gets a ifcuid. If the object is somehow copied inside FreeCAD the id will not changed. Thus identical ids on next export. See https://forum.freecadweb.org/viewtopic.php?f=39&t=49689&p=426885#p426885
cheers bernd
BTW: it is good to have some software which is very strict with ifc standard. We would not have found this bug. Well done BlenderBIM :-)
@Moult
How do you solve this in Blender? A object should keep his uuid over his livetime, no matter how often a project is saved to Blender format, even under a different file name. But if a object is copied, no matter which tools of Blender is used to copy the uuid should be reseted and a new should be used.
That is exactly the problem in FreeCAD. ATM the id is saved just in a dict. If an object is copied the id is duplicated. It is impossible to attrac this in the copy method as there are dozens of possibilities to copy a object in FreeCAD. I opened a topic about this but it is not solved yet: https://forum.freecadweb.org/viewtopic.php?f=10&t=49818
@bernd in Blender, there are two ways to solve it. The first is to have a callback watching the depgraph - whenever an object is copied, it can automatically reset just that attribute. The second way is to leave the attribute as a duplicate, and wait for the user to manually resolve it, or resolve it at export time and force a new GlobalId at export time when it detects a duplicate GlobalId.
I use the second approach.
@Moult said:
leave the attribute as a duplicate, and wait for the user to manually resolve it, or resolve it at export time and force a new GlobalId at export time when it detects a duplicate GlobalId.
If you find a duplicate GlobalId on export? How do you know which one is the original and which is the copy?
@bernd the copy is later in the list of objects.
:-)
exactly this was my first idea for FreeCAD too ... But I am not 100 % happy with it because it might be not failsafe in all cases.
I might go for this for a first fast solution.
Login or Register to reply.