Just open the file with FreeCAD. Screen of freeze is attached.
code to just import the problem shape:
Code: Select all
import ifcopenshell
from ifcopenshell import geom
settings = ifcopenshell.geom.settings()
settings.set(settings.USE_BREP_DATA,True)
settings.set(settings.SEW_SHELLS,True)
settings.set(settings.USE_WORLD_COORDS,True)
settings.set(settings.INCLUDE_CURVES,False) # for stuct
file_path = 'C:\\Users\\BHA\\Desktop\\diversers\\3D--FC--diverse\\probleme_errors_nicht_im_forum\\building_modell_freecad_freezes.ifc'
f = ifcopenshell.open(file_path)
f.by_type('IfcPerson')
entity = f.by_id(18405)
print entity
cr = ifcopenshell.geom.create_shape(settings, entity)
# exception seams to be an IfcOpenShell problem !!!
'''
# not needed anymore because it has problems before
brep = cr.geometry.brep_data
print brep
import Part
shape = Part.Shape()
shape.importBrepFromString(brep)
Part.show(shape)
'''
output for me:
Code: Select all
Python 2.7.8 (default, Nov 17 2014, 20:37:05) [MSC v.1800 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import ifcopenshell
>>> from ifcopenshell import geom
>>> settings = ifcopenshell.geom.settings()
>>> settings.set(settings.USE_BREP_DATA,True)
>>> settings.set(settings.SEW_SHELLS,True)
>>> settings.set(settings.USE_WORLD_COORDS,True)
>>> settings.set(settings.INCLUDE_CURVES,False) # for stuct
>>>
>>>
>>> file_path = 'C:\\Users\\BHA\\Desktop\\diversers\\3D--FC--diverse\\probleme_errors_nicht_im_forum\\building_modell_freecad_freezes.ifc'
>>> f = ifcopenshell.open(file_path)
>>> f.by_type('IfcPerson')
[#5=IfcPerson($,'Nicht definiert',$,$,$,$,$,(#1))]
>>>
>>>
>>> entity = f.by_id(18405)
>>> print entity
#18405=IfcWall('0s3v$ll25A$uYnr5AiVDst',#22,'Wand-081',$,$,#18125,#18401,'360F9FEF-BC21-4AFF-88B1-D452AC7CDDB7')
>>> cr = ifcopenshell.geom.create_shape(settings, entity)
>>> cr = ifcopenshell.geom.create_shape(settings, entity)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\0_BHA_privat\progr\FreeCAD_0.17.xxxxx_x64_dev_win\bin\lib\site-packages\ifcopenshell\geom\__init__.py", line 77, in create_shape
repr.wrapped_data if repr is not None else None
RuntimeError: Failed to process shape
>>>
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12324 (Git)
Build type: Release
Branch: master
Hash: 81e2480ca62c48b992db6e438cc69640a5166631
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Switzerland (de_CH)