https://forums.buildingsmart.org/t/presenting-blender-as-a-new-ifc-authoring-tool/1791/69
The IFC files that Herb provides all result in errors when I try to view them. I suspect related to multiprocessing.
INFO:OCC.Display.backend:backend loaded: qt-pyqt5
QLayout: Attempting to add QLayout "" to code_edit "", which already has a layout
###### 3D rendering pipe initialisation #####
Display3d class initialization starting ...
Aspect_DisplayConnection created.
Graphic_Driver created.
V3d_Viewer created.
AIS_InteractiveContext created.
V3d_View created
Xw_Window created.
Display3d class successfully initialized.
########################################
Layer manager created
Layer dimensions: 477, 281
property set dictionary has 0 entries
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/ifcopenshell/geom/app.py", line 78, in run
if not it.initialize():
File "/usr/lib/python3.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 533, in initialize
return _ifcopenshell_wrapper.iterator_double_precision_initialize(self)
RuntimeError: Token $ at 4529 invalid instance name
His files also seem to be a little bit invalid (e.g. global ID is not an encoded guid), but I don't know how to easily make a list of invalid IFC behaviours with ifcopenshell, so I'm not sure which are fatal errors and which are merely "please follow the schema rules better" :)
seem to be a little bit invalid
True, in this case in particular it seems the following line is causing issues:
#128= IFCREPRESENTATIONMAP($,#127);
where no optional attributes are in fact present.
~
ENTITY IfcRepresentationMap;
MappingOrigin : IfcAxis2Placement;
MappedRepresentation : IfcRepresentation;
INVERSE
HasShapeAspects : SET [0:?] OF IfcShapeAspect FOR PartOfProductDefinitionShape;
MapUsage : SET [0:?] OF IfcMappedItem FOR MappingSource;
WHERE
ApplicableMappedRepr : 'IFC4.IFCSHAPEMODEL' IN TYPEOF(MappedRepresentation);
END_ENTITY;
~
Apparently this is handled differently in the single threaded code path where in the multi threaded code path the exception is not caught. Let's keep the issue open as a reminder to address that.
Great! How did you manage to determine that line from the error message? I didn't quite understand it.
RuntimeError: Token $ at 4529 invalid instance name
4529 is the byte offset of the token in the file.
Bump :)
Bump :)
Sorry for the delay. Have a look if ^ fixes your problems.
Thanks :) I really appreciate it! Will wait for the new IfcOpenBot build to test!
I've just tested this, and indeed there is no more segfault (woohoo!), but there is a problem for tower - 50 storeys.ifc for both multiprocessing and no multiprocessing. At the bottom of the tower, some panels are missing, and only the spandrel of the panel is shown, whereas the glazing portion of the facade seems to be missing. See picture:

I'd say our priority should be something like: (a) fix segfaults (b) fix bugs on valid input (c) graceful handling of invalid input. From that point of view I'd rather prioritize some of the other issues over further improvements on this issue.
I can also imagine that based on ifcopenshell.validate and IfcPatch we can think about applying fixes to IFC files prior to feeding them to the geometry handling.
Absolutely :) feel free to prioritise other issues - the order of priority makes sense. I will close this issue, as the file seems to contain many validation errors, so is probably not worth digging too deeply into it.
Today, i have same problem , how we can start for this error ?
@chuongmep it is likely that your error is not the same. I recommend starting a new issue and attaching your file along with an explanation of any error logs.