yorikvanhavre / freecad-nativeifc Goto Github PK
View Code? Open in Web Editor NEWA FreeCAD module to work with IFC files natively
License: GNU General Public License v3.0
A FreeCAD module to work with IFC files natively
License: GNU General Public License v3.0
Use IfcOpenShell to generate SVG code.
When opening a FCStd file containing IFC objects with children, colors are lost.
Color dict should be rebuilt from children each time the shape changes...
I updated the Addon to 23.10.27
A test import gives this errors:
(I think I had the same Error also with the old version)
flag
flag2
No stream support: No module named 'lark'
Vorheriger Cache-Prozess wurde unterbrochen, wird neu gestartet...
Git ist deaktiviert, Git-Makros werden übersprungen
Fehler beim Verbinden mit dem Wiki, FreeCAD kann die Wiki-Makroliste zu diesem Zeitpunkt nicht abrufen
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_import.py", line 47, in open
insert(filename, doc.Name)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_import.py", line 74, in insert
prj_obj = ifc_tools.create_document_object(
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 101, in create_document_object
create_children(obj, ifcfile, recursive=True, assemblies=False)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 311, in create_children
result.extend(create_child(obj, child))
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 289, in create_child
subresult.extend(create_child(child, building))
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 301, in create_child
create_children(
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 311, in create_children
result.extend(create_child(obj, child))
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 301, in create_child
create_children(
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 311, in create_children
result.extend(create_child(obj, child))
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 279, in create_child
child = create_object(element, doc, ifcfile, mode)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 253, in create_object
ifc_layers.add_layers(obj, ifcentity, ifcfile)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_layers.py", line 98, in add_layers
<class 'AttributeError'>: 'NoneType' object has no attribute 'Group'
OS: Windows 11 build 22621
Word size of FreeCAD: 64-bit
Version: 0.21.1.33668 +26 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: German/Switzerland (de_CH)
Installed mods:
* Assembly3 0.12.0
* BIM 2021.12.0
* dodo 1.0.0
* FreeCAD-NativeIFC 2023.10.27
* sheetmetal 0.3.1
Currently, to avoid the container objects to copy the coin representation of their children, when they have no shape, they get assigned a dummy 1x1x1mm cube. This should be fixed.
Idea from Arch Site: https://github.com/FreeCAD/FreeCAD/pull/8409/files#diff-06458722fe7010f919d3e42e72455878346b8934992bbfee43517ce49f595511R1029
Add a way to obtain an IFC diff from the current state (compared to the saved version), so one can make sure everything went as planned. In a first moment text-only, but later then maybe graphically...
Hello.
from ifcopenshell import api
<class 'ImportError'>: cannot import name 'api' from 'ifcopenshell' (G:\freecad\git\build\bin\lib\site-packages\ifcopenshell\__init__.py)
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32165 (Git)
Build type: Release
Branch: master
Hash: 0da14beb27357cc61584335bacbf47f3ef0cc66b
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods:
* beso
* BIM_Workbench 2021.12.0
* civilTools
* dodo 1.0.0
* etabs_api
* FreeCAD-Help
* FreeCAD-NativeIFC 2022.10.20
* git.7z
* momen
* OSAFE 2022.5.29
thanks
This is basically a stub to discuss implementaiton (and for @Moult to explain his visions ;) )
We now have a basic decomposition in the FreeCAD document: Project, site, building, storey, and their direct children. However, there is a lot more to fetch on demand from the IFC file. For ex:
In BlenderBIm you basically press some "Edit" buttons to reveal these things in the UI.
I'm not sure how to proceed here. Clearly, materials are FreeCAD objects (stored in a special group), Types too (should be stored in a special group too), geometry constructions should also become FreeCAD objects, and properties and property sets should become object properties (tied to style properties if applicable).
After importing the IFC Schependomlaan.ifc file and selecting "Expand property set" with a right click at an object (i.e. dakpan (vlak)005) I see this error:
09:15:10 Traceback (most recent call last):
09:15:10 File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_viewproviders.py", line 209, in showProps
09:15:10 ifc_tools.show_psets(self.Object)
09:15:10 File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 1212, in show_psets
09:15:10 obj.addProperty("App::PropertyString", pname, gname)
09:15:10 NameError: {'sclassname': 'class Base::NameError', 'sErrMsg': "Invalid property name 'Home Story'", 'sfile': 'D:\\bld\\freecad_1684045270349\\work\\src\\App\\DynamicProperty.cpp', 'iline': 176, 'sfunction': 'class App::Property *__cdecl App::DynamicProperty::addDynamicProperty(class App::PropertyContainer &,const char *,const char *,const char *,const char *,short,bool,bool)', 'swhat': "Invalid property name 'Home Story'", 'btranslatable': False, 'breported': False}
Steps to reproduce:
On a huge ifc from a architect I got problems. I have been used this ifc on various viewers including Solibrie, BIMCollabZoom, BIMVision and FreeCAD and BlenderBIM, as well as CAD Allplan. Noone returned big problems and all parts seams correct, BUT
dozens of objects missing the ObjectPlacement. Somehow all the programme did not have a problem with it. As an example some code attached ...
Python 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>>
>>> ### Begin command Std_Open
>>> import importIFCparse
>>> importIFCparse.open(u"C:/Users/BHA/Desktop/fehlerhaftes_ifc_laed_nicht_nativ_ifc/4130_ARC_ROHM01_20230203.ifc")
>>> import ifcopenshell
>>> ifcfile = ifc = ifcopenshell.open("C:/Users/BHA/Desktop/fehlerhaftes_ifc_laed_nicht_nativ_ifc/4130_ARC_ROHM01_20230203.ifc")
>>> print(ifc.by_type("IfcProject")[0])
>>> ### End command Std_Open
>>>
>>> ifcfile[409407]
#409407=IfcSlab('1GQsvNK6n9e9nfjgTH$n8Z',#11,'Beton','Dach, 22 cm Stärke
22 Beton','Dach 22cm',#395870,#409405,$,.ROOF.)
>>>
>>> ifcfile[409407].ObjectPlacement
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\entity_instance.py", line 136, in __getattr__
self.wrapped_data.get_argument(idx), self.wrapped_data.file
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 4833, in get_argument
return _ifcopenshell_wrapper.entity_instance_get_argument(self, *args)
RuntimeError: Instance #395870 not found
>>>
>>> ifcfile[395870]
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\file.py", line 313, in __getitem__
return entity_instance(self.wrapped_data.by_id(key), self)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 4515, in by_id
return _ifcopenshell_wrapper.file_by_id(self, id)
RuntimeError: Instance #395870 not found
>>>
the native IFC importer has problems with this or at least he is the only one who reports back the big problems ... But the representation of thes objects seams shown in 3Dview. IMHO we should inform the user but catch such problem.
OS: Windows 11 build 22621
Word size of FreeCAD: 64-bit
Version: 0.21.1.33694 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.10.12, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: German/Switzerland (de_CH)
Installed mods:
* FreeCAD-NativeIFC 2023.10.27
I uninstalled FreeCAD with User settings, an this FreeCAD runs a portable version in Windows
Is a different IFC file than the last times I wrote Issues.
10:31:43 DirectWrite: CreateFontFaceFromHDC() failed (Gibt einen Fehler in einer Eingabedatei an, zum Beispiel eine Schriftartdatei.) for QFontDef(Family="8514oem", pointsize=10, pixelsize=20, styleHint=5, weight=50, stretch=100, hintingPreference=0) LOGFONT("8514oem", lfWidth=0, lfHeight=-20) dpi=192
10:32:13 DirectWrite: CreateFontFaceFromHDC() failed (Gibt einen Fehler in einer Eingabedatei an, zum Beispiel eine Schriftartdatei.) for QFontDef(Family="8514oem", pointsize=10, pixelsize=20, styleHint=5, weight=75, stretch=100, hintingPreference=0) LOGFONT("8514oem", lfWidth=0, lfHeight=-20) dpi=192
10:33:27 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_import.py", line 48, in open
insert(filename, doc.Name)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_import.py", line 86, in insert
ifc_psets.load_psets(prj_obj)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_psets.py", line 232, in load_psets
load_psets(child)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_psets.py", line 232, in load_psets
load_psets(child)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_psets.py", line 232, in load_psets
load_psets(child)
[Previous line repeated 1 more time]
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_psets.py", line 226, in load_psets
show_psets(obj)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_psets.py", line 94, in show_psets
ptype, value = pvalue.split("(", -1)
<class 'ValueError'>: too many values to unpack (expected 2)
follow Error flooded the log window
10:34:11 Traceback (most recent call last):
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_objects.py", line 129, in execute
ifc_generator.generate_geometry(obj, cached=cached)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_generator.py", line 65, in generate_geometry
elements = get_decomposition(obj)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_generator.py", line 316, in get_decomposition
elements = get_decomposed_elements(element, obj)
File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_generator.py", line 347, in get_decomposed_elements
for child in ifcopenshell.util.element.get_decomposition(
<class 'TypeError'>: get_decomposition() got an unexpected keyword argument 'is_recursive'
10:35:09 Recompute failed!
attributes need to be rebuilt
On several models from Architects I do have problem to import a geometry into FreeCAD native IFC. They work flawless with FreeCAD standard importer and with BlenderBIM. Attached a very simple file which shows the problem. Open the file with standard FreeCAD importer looks great. Open the file with native importer. The geometry is missing. After import in native importer run the following code. It returns False, thus no geometry ...
import ifcopenshell
import ifc_tools
from ifcopenshell import geom
settings = ifc_tools.get_settings(ifcfile)
iterator = ifcopenshell.geom.iterator(settings, ifcfile, 1, include=[ifcfile[83]])
iterator.initialize()
I have not yet posted this on IfcOpenShell ... Just waiting for your opinion Yorik.
How about another "shapemode" ... no geometry at all. Means the ifc will be parsed only and objects will be created in the regard of strategy pref. This is helpful for very large files if one only needs the ifcopenshell file object or some attributes but no geometry. Or geometry of a certyain element or spatial structure. Thus only the needed geometry could be loaded after import by right click load in tree view.
Hi Yorik!
I found another strange behaviour:
PS: BlenderBim handles the file without problems
Furniture import is currently disabled in https://github.com/yorikvanhavre/FreeCAD-NativeIFC/blob/main/ifc_tools.py#L651
Need to:
OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git)
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods:
* FreeCAD-NativeIFC 2022.10.20
IfcSpaces work at the same time as an own feature to represent a space, but also as an aggregator for some other objects. Currently they are discarded by the importer.
This is basically for discussion.
Up to now, this happens:
This is pretty fast, a medium file like schependomlaan (47Mb) imports in 23 seconds on a ryzen9. Further optimizations are possible, like caching, or even using only mesh representation
What should happen next:
Other ideas:
I'm not sure what word describes the wish better.
Hi Yorik,
I am getting error while adding new object created in freecad to ifc. the error is same while trying to add from the UI and also through python console
06:22:44 Traceback (most recent call last): File "/home/arun/.local/share/FreeCAD/Mod/FreeCAD-NativeIFC/./ifc_viewproviders.py", line 246, in dropObject ifc_tools.aggregate(incoming_object, parent) File "/home/arun/.local/share/FreeCAD/Mod/FreeCAD-NativeIFC/./ifc_tools.py", line 921, in aggregate product = create_product(obj, parent, ifcfile) File "/home/arun/.local/share/FreeCAD/Mod/FreeCAD-NativeIFC/./ifc_tools.py", line 988, in create_product representation, placement, shapetype = exportIFC.getRepresentation( File "/tmp/.mount_FreeCAmo37dh/usr/Mod/Arch/exportIFC.py", line 2067, in getRepresentation profile = getProfile(ifcfile,pi) File "/tmp/.mount_FreeCAmo37dh/usr/Mod/Arch/exportIFC.py", line 1906, in getProfile pxvc = ifcbin.createIfcDirection(tuple(d)[:2]) <class 'NameError'>: name 'ifcbin' is not defined
Would you support this?
I would like to move all methods which would run on pure IfcOpenShell without FreeCAD obj or FreeCAD methods (except such methods from importIFChelper which also would run on pure IfcOpenShell) in a separate module. These ones could be used outside of FreeCAD without importing FreeCAD. This would make it much easier to reuse thesm in other tools and programme because one does not need to create a FreeCAD document or a FreeCAD object to use them.
"ifc_tools" would be split in "ifc_tools_ifc" and "ifc_tools_fc" or if you prefere other names they does not really matter for me.
Steps to reproduce:
Steps to reproduce:
How is it possible to interact with the IfcOpenShell ifcfile object by python.
Workflow:
see https://forum.freecad.org/viewtopic.php?t=72345&start=120#p661527
cheers bernd
I'm trying to add a Part or PartDesign object to a IFC.
The following code adds a wall to my project:
wall = Arch.makeWall(None,220,400,20)
ifc_tools.aggregate(wall, project)
However, when i run ifc_tools.aggregate(obj, project)
, where obj
is a PartDesign object, i get the following error:
>>> ifc_tools.aggregate(obj, project)
Exception ignored in: <function entity_instance.__del__ at 0x7fd06c18bac0>
Traceback (most recent call last):
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 132, in __del__
self.wrapped_data.file = None
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 143, in __getattr__
attr_cat = self.wrapped_data.get_attribute_category(name)
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 143, in __getattr__
attr_cat = self.wrapped_data.get_attribute_category(name)
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 143, in __getattr__
attr_cat = self.wrapped_data.get_attribute_category(name)
[Previous line repeated 995 more times]
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 142, in __getattr__
INVALID, FORWARD, INVERSE = range(3)
RecursionError: maximum recursion depth exceeded in comparison
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/smr/.local/share/FreeCAD/Mod/FreeCAD-NativeIFC/./ifc_tools.py", line 893, in aggregate
product = create_product(obj, parent, ifcfile)
File "/home/smr/.local/share/FreeCAD/Mod/FreeCAD-NativeIFC/./ifc_tools.py", line 944, in create_product
product = api_run("root.create_entity", ifcfile, ifc_class=ifcclass, name=name)
File "/home/smr/.local/share/FreeCAD/Mod/FreeCAD-NativeIFC/./ifc_tools.py", line 229, in api_run
result = ifcopenshell.api.run(*args, **kwargs)
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/api/__init__.py", line 66, in run
result = usecase_class(ifc_file, **settings).execute()
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/api/root/create_entity.py", line 74, in execute
element = self.file.create_entity(
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/file.py", line 318, in create_entity
e = entity_instance((self.schema_identifier, type), self)
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 119, in __init__
e = ifcopenshell_wrapper.new_IfcBaseClass(*e)
File "/tmp/.mount_FreeCAUhQwpr/usr/lib/python3.10/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 4374, in new_IfcBaseClass
return _ifcopenshell_wrapper.new_IfcBaseClass(schema_identifier, name)
ValueError: invalid null reference in method 'new_IfcBaseClass', argument 2 of type 'std::string const &'
OS: Ubuntu 23.10 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.35803 (Git) AppImage
Build type: Release
Branch: main
Hash: 90c90f705bec20faf4b8bb419574134c33c7d4b5
Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods:
* DynamicData 2.60.0
* FreeCAD-NativeIFC 2023.10.27
* BIM 2021.12.0
Don't know if it's me missing the right workflow or if it's a bug:
Traceback (most recent call last):
File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_viewproviders.py", line 72, in claimChildren
return self.Object.Group
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Group'
13:24:35 Running the Python command 'BIM_Project' failed:
Traceback (most recent call last):
File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\BIM\.\BimWrappedTools.py", line 64, in Activated
project = ifc_tools.create_document(FreeCAD.ActiveDocument)
File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 90, in create_document
site = aggregate(Arch.makeSite(), obj)
File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 918, in aggregate
product = create_product(obj, parent, ifcfile)
File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 974, in create_product
exportIFC.ifcbin = exportIFCHelper.recycler(ifcfile, template=False)
recycler.__init__() got an unexpected keyword argument 'template'
Decide how to go about that...
Reference: https://blenderbim.org/docs/users/georeferencing.html
when i import the IFC Schependomlaan.ifc file I see lots of errors I don't understand:
09:06:51 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2216: Bnd_Box is void
09:06:56 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2309: Bnd_Box is void
09:07:05 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2466: Bnd_Box is void
09:07:07 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2490: Bnd_Box is void
09:07:20 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2653: Bnd_Box is void
09:07:28 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:28 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:28 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:28 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:31 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:31 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:35 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:38 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:38 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:53 DEBUG: ifc_tools.get_geom_iterator: Invalid iterator
09:07:53 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2759: Bnd_Box is void
09:07:53 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2862: Bnd_Box is void
09:07:53 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2865: Bnd_Box is void
09:07:53 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2879: Bnd_Box is void
09:07:53 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject2887: Bnd_Box is void
09:08:01 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject3105: Bnd_Box is void
09:08:01 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject3107: Bnd_Box is void
09:08:01 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject3109: Bnd_Box is void
09:08:01 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject3111: Bnd_Box is void
09:08:09 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject3187: Bnd_Box is void
09:08:09 <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of Unnamed#IfcObject3189: Bnd_Box is void
09:08:26 Debug: No Shape returned for object 1034437, IfcVirtualElement, IfcVirtualElement
09:08:26 Debug: No Shape returned for object 1040670, IfcVirtualElement, IfcVirtualElement001
09:08:26 Debug: No Shape returned for object 1047667, IfcVirtualElement, IfcVirtualElement002
09:08:26 Debug: No Shape returned for object 1047706, IfcVirtualElement, IfcVirtualElement003
09:08:26 Debug: No Shape returned for object 1052304, IfcVirtualElement, IfcVirtualElement004
09:08:26 Debug: No Shape returned for object 1056520, IfcVirtualElement, IfcVirtualElement005
09:08:26 Debug: No Shape returned for object 1059552, IfcVirtualElement, IfcVirtualElement006
09:08:26 Debug: No Shape returned for object 1059592, IfcVirtualElement, IfcVirtualElement007
09:08:26 Debug: No Shape returned for object 1063273, IfcVirtualElement, IfcVirtualElement008
09:08:26 Debug: No Shape returned for object 1066491, IfcVirtualElement, IfcVirtualElement009
09:08:26 Debug: No Shape returned for object 1066531, IfcVirtualElement, IfcVirtualElement010
09:08:26 Debug: No Shape returned for object 1073211, IfcVirtualElement, IfcVirtualElement011
09:08:26 Debug: No Shape returned for object 1078243, IfcVirtualElement, IfcVirtualElement012
09:08:26 Debug: No Shape returned for object 1078283, IfcVirtualElement, IfcVirtualElement013
09:08:26 Imported IFC Schependomlaan.ifc ( 47.0 Mb ) in 04:17
I've created a beam from the BlenderBIM demo project with a void and imported it to FreeCAD.
In the screenshot you can see how the Void/opening shows as a very small cube in FreeCAD.
Attached the IFC file.
Link FreeCAD placements to underlying IFC placements.
We need the following functionality:
IfcOpenShell related structures:
https://blenderbim.org/docs-python/autoapi/ifcopenshell/util/placement/index.html
https://blenderbim.org/docs-python/autoapi/ifcopenshell/api/geometry/edit_object_placement/index.html
This is another point i'd like to understand: @Moult how much is local placement used generally in Ifcs out there?
reading from Geometry use definitions, ref. https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ifcgeometricconstraintresource/lexical/ifclocalplacement.htm there are conventions like:
In FreeCAD we have objects that can perfectly represent this @yorikvanhavre . I know we already discussed that in the past and we had different positions, should we adopt GeoFeatureGroups (Building, storey) or ShapeGroups (site) when IfcLocalPlacement is used? I think so, but what do you think?
Just out of curiosity, did you choose to reference the IFC file with an object (instead of using document .Meta) to be able to reference more IFC Files in the same FC document?
"BlenderBIM workbench" is not a very good name. What about "IFC workbench" or "nativeIFC"?
Not sure it will have a workbench, though. I think we could simply seamlessly integrate it to the BIM workbench, so BIM tools become nativeIFC-aware...
I found this and tried using https://github.com/yorikvanhavre/FreeCAD-NativeIFC/blob/main/doc/installation.md
winget install FreeCAD.FreeCAD
(without root)flatpack install org.freecadweb.FreeCAD
https://github.com/yorikvanhavre/FreeCAD-NativeIFC/blob/main/doc/installation.md
class 'ImportError'>: cannot import name 'api' from 'ifcopenshell' (C:\Users\%username%\AppData\Local\Programs\FreeCAD 0.21\bin\lib\site-packages\ifcopenshell\__init__.py)
<class 'ImportError'>: IfcOpenShell not built for 'linux/64bit/python3.10'
Steps to reproduce:
ATM a unreferenced objects does not get a IfcObject in FreeCAD after import. Best would be if they get a own group right under the IfcProject object. Expand child does not work at all because there is no structure in the file.
Add ifcoopenshell as a permitted dependency that the addon manager can auto-download.
I was hanging around the code this morning and studying a bit BB ifc.py and import_ifc.py.
Shouldn't it be a matter of setting up an IfcStore and substituting Blender objects with FC objects? That is of course an enormous task, but I need to get the general idea of what we are up to :)
In my opinion the Popup Dialog that appear if you open the IFC should be inside the Task Area.
At the End of the Importing I would Like to see a little statistic about containing data.
I propose to add a Feature to the "Tree View" that represent the original IFC-Filename.
Please add this feature into the context menu:
Any plans to support IFC4.3.2 for infrastructure? The reason I ask is that I've been adding geometry mapping to IfcOpenShell on the v0.8.0 branch, c++ code, for alignment and linear referencing.
Ultimately I want to make BlenderBIM or FreeCAD support infrastructure, bridges in particular. I'm thinking something along the lines of road, bridge, and rail workbenches supporting native IFC.
Hello, team.
Does anyone know how to fix the error "signed with custom identity or ad-hoc?"
When I execute import ifcopenshell
in the FreeCAD App, I got the following errors.
Best regards.
>>> import ifcopenshell
Traceback (most recent call last):
File "/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/__init__.py", line 61, in <module>
from . import ifcopenshell_wrapper
File "/Applications/FreeCAD.app/Contents/Resources/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
return original_import(name, *args, **kwargs)
File "/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/ifcopenshell_wrapper.py", line 13, in <module>
from . import _ifcopenshell_wrapper
File "/Applications/FreeCAD.app/Contents/Resources/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
return original_import(name, *args, **kwargs)
ImportError: dlopen(/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/_ifcopenshell_wrapper.so, 0x0002): tried: '/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/_ifcopenshell_wrapper.so' (code signature in <82625F66-0FB6-3B7B-9D0D-5D0C432ABD9D> '/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/_ifcopenshell_wrapper.so' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/System/Volumes/Preboot/Cryptexes/OS/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/_ifcopenshell_wrapper.so' (no such file), '/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/_ifcopenshell_wrapper.so' (code signature in <82625F66-0FB6-3B7B-9D0D-5D0C432ABD9D> '/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/_ifcopenshell_wrapper.so' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/FreeCAD.app/Contents/Resources/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
return original_import(name, *args, **kwargs)
File "/Users/user/Library/Application Support/FreeCAD/AdditionalPythonPackages/py310/ifcopenshell/__init__.py", line 69, in <module>
raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'darwin/64bit/python3.10'
I succeed in loading iopenshell
in the python 3.10.
ipython
Python 3.10.11 (main, May 17 2023, 13:56:28) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.15.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import sys
In [2]: sys.path.append("/Users/user/Library/Application Support/FreeCAD/Additi
...: onalPythonPackages/py310/")
In [3]: import ifcopenshell
No stream support: No module named 'lark'
In [4]: ifcopenshell.version
Out[4]: 'v0.7.0-6c9e130ca'
I'm playing around with the sample-test files from buildingSMART.
the Clinic_Plumbing.ifc had this import error:
16:18:48 Traceback (most recent call last):
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_viewproviders.py", line 158, in expandChildren
16:18:48 ifc_tools.create_children(
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 320, in create_children
16:18:48 result.extend(create_child(obj, child))
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 288, in create_child
16:18:48 child = create_object(element, doc, ifcfile, mode)
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 262, in create_object
16:18:48 ifc_layers.add_layers(obj, ifcentity, ifcfile)
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_layers.py", line 95, in add_layers
16:18:48 lay = get_layer(layer, proj)
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_layers.py", line 55, in get_layer
16:18:48 group = ifc_tools.get_group(project, "IfcLayersGroup")
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 1189, in get_group
16:18:48 group = add_object(doc, otype="group", oname=name)
16:18:48 File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 448, in add_object
16:18:48 obj = document.addObject(ftype, oname, proxy, vp, False)
16:18:48 AttributeError: 'NoneType' object has no attribute 'addObject'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.