Integration of BlenderBIM Features : FreeCAD Arch/BIM - Native IFC

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

I have long used AppImage on Fedora, with built-in IfcOpenShell :D
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

Trying to understand the code, ifc_tools.py get_children reads -

( https://github.com/yorikvanhavre/FreeCA ... #L110-L124 )

Code: Select all

def get_children(obj, ifcfile):

    """Returns the direct descendants of an object"""

    ifcentity = ifcfile[obj.StepId]
    children = []
    for rel in getattr(ifcentity, "IsDecomposedBy", []):
        children.extend(rel.RelatedObjects)
    for rel in getattr(ifcentity, "ContainsElements", []):
        children.extend(rel.RelatedElements)
    for rel in getattr(ifcentity, "HasOpenings", []):
        children.extend([rel.RelatedOpeningElement])
    for rel in getattr(ifcentity, "HasFillings", []):
        children.extend([rel.RelatedBuildingElement])
    return filter_elements(children)

Googling BuildingSmart + IsDecomposedBy or ContainsElements seems return pages not directly relevant. Any hint ? Thanks.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

Latest update, working expand children working :)
( some error in report )

Seems there is no hint which objects have children until user right click on every object, can have different object icon ? Thanks.


Screenshot from 2022-12-05 01-33-55.png
Screenshot from 2022-12-05 01-33-55.png (195.56 KiB) Viewed 1938 times
Screenshot from 2022-12-05 01-37-34.png
Screenshot from 2022-12-05 01-37-34.png (217.02 KiB) Viewed 1944 times
Screenshot from 2022-12-05 01-46-40.png
Screenshot from 2022-12-05 01-46-40.png (230.69 KiB) Viewed 1944 times
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by yorik »

It's complicated because each IFC file is different :) schependomlaan is also my base example..
paullee wrote: Sat Dec 03, 2022 2:20 pm Googling BuildingSmart + IsDecomposedBy or ContainsElements seems return pages not directly relevant. Any hint ? Thanks.
No and I also found weird things in different files... But still not sure how best to deal with this and have a reliable method to get children. Also because the question "what is a child" is complicated within IFC :)
ragohix769 wrote: Fri Dec 02, 2022 12:49 am In my system ifcopenshell is already installed:
Indeed I'm not sure the addon manager can install stuff on a snap version of FreeCAD.. I'd suggest:
1) install ifcopenshell via pip OUTSIDE FreeCAD (in a terminal for ex) - I think you did this already
2) verify if ifcopenshell is available within FreeCAD (

Code: Select all

import FreeCAD
in the python console of FreeCAD)
3) If not, verify what python paths are available to FreeCAD (

Code: Select all

import sys; print(sys.path)
)
4) Verify where ifcopenshell is installed (

Code: Select all

import ifcopenshell;print(ifcopenshell.__file__
from a terminal where you launch 'python')
5) Verify that the path given is in the sys.path informed in point 3). If not, we might need to adapt something in the snap packages I think...
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by ragohix769 »

ragohix769 wrote: Fri Dec 02, 2022 12:49 am In my system ifcopenshell is already installed:
[...]
5) Verify that the path given is in the sys.path informed in point 3). If not, we might need to adapt something in the snap packages I think...
ifcopenshell it's correctly installed in my system, that's for sure also because in the Daily (last update 1 month ago) version (in PPA repos) of FreeCAD that I still use, nativeifc it's working I can import ifc files without any problem. Here is the log from the shell

Code: Select all

:~$ pip install ifcopenshell
Requirement already satisfied: ifcopenshell in ./.local/lib/python3.8/site-packages (0.7.0)
If I try to see if ifcopenshell is present in FreeCAD via python console (in FC) it return this:

Code: Select all

 IfcOpenShell was not found on this system. IFC support is disabled.
Visit https://wiki.freecadweb.org/IfcOpenShell to learn about installing it.
So maybe ifcopenshell should be included in the package to call it under local snap/ paths, because ifcopenshell in the system it's not seen by snap version.

This is another (big) advantage of PPA packages, IMHO, pity that was abandoned.
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

A minor observation:-

Just try to update the Add-on again, have noted that the reported date of current installation is not updated.

I have just updated, restarted, and noted the date of latest/current update is still outdated, a bit confused :lol:


Screenshot from 2022-12-11 12-21-38.png
Screenshot from 2022-12-11 12-21-38.png (19.57 KiB) Viewed 1719 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

Unfortunately, importing / opening the IFC Schependomlaan.ifc crash FC, everytime when it seems import / opening reach almost 100% :roll:


Screenshot from 2022-12-11 12-21-38.png
Screenshot from 2022-12-11 12-21-38.png (19.57 KiB) Viewed 1700 times

Code: Select all

OS: Fedora Linux 36 (Workstation Edition) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.30345 (Git)
Build type: Release
Branch: master
Hash: f42a47aa0fd8c4f34ef63c185d9f29b9b6e84737
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * dodo 1.0.0
  * DynamicData 2.46.0
  * ArchTextures
  * BOLTSFC.backup1666323893.5041647
  * BOLTSFC
  * FreeCAD-BlenderBIM.backup1666328110.015535
  * FreeCAD-BlenderBIM.backup1666737837.420096
  * FreeCAD-BlenderBIM 2022.10.20
  * 3rd link to Paul
  * 3rd link to SketchArchPlus
  * BIM.backup1670731522.690569
  * BIM 2021.12.0
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

Curiously, after a few attempt, it now open (not sure if it is to do with I have rebooted the system) but crash when i try expand Children.
FreeCAD (copy).log
(22.56 KiB) Downloaded 58 times

EDIT - Then I try closed my FireFox and it expand Children without problem; and then I re-open FireFox, and when the latter is up, FC crahes; not enough memory ? :roll:


Screenshot from 2022-12-11 18-21-43.png
Screenshot from 2022-12-11 18-21-43.png (66.22 KiB) Viewed 1647 times
Screenshot from 2022-12-11 18-30-59.png
Screenshot from 2022-12-11 18-30-59.png (297.69 KiB) Viewed 1647 times
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by ragohix769 »

paullee wrote: Sun Dec 11, 2022 10:02 am EDIT - Then I try closed my FireFox and it expand Children without problem; and then I re-open FireFox, and when the latter is up, FC crahes; not enough memory ? :roll:
If it's a memory problem and you have a swap file enabled (like is very common in every standard installation) IMHO it's difficult having a crash, you should have a continuous read/write on disk rather then a crash. Anyway you can log memory in realtime to see if that's the problem, open the shell and use a top or htop command on background when running programs.

I cannot use or test anymore NativeIFC because I cannot install or use ifcopenshell with the snap package (I had to use snap because the daily on PPA repos it's not updated anymore :-( ), so for me it's not possibile to try anything on edge with this addon :-(
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Integration of BlenderBIM Feaures : FreeCAD Arch/BIM

Post by paullee »

Thanks for the heads-up, will have a look if the system has read/write swap on native IFC importing.

Not sure if you can use AppImage, which has built-in IfcOpenShell, and I have no problem on Fedora 36.


Now, (without running firefox) I have expanded all children in my last attempt. 2 weird things though:-

1. In an earlier attempt to import, unknown to me what I had done during the process, I had expanded a few objects, but found the rest of objects had no more options to expand :roll:
(see screencapture - can't capture the context menu which has no 'expand children' )
(No problem in my last attempt w/o Firefox as mentioned above)

2. There are a few cubes, large and small, associated with the IFC objects.
(see screencapture)


Screenshot from 2022-12-11 20-22-52.png
Screenshot from 2022-12-11 20-22-52.png (323.18 KiB) Viewed 1588 times
Screenshot from 2022-12-11 20-19-07.png
Screenshot from 2022-12-11 20-19-07.png (304.24 KiB) Viewed 1588 times
Screenshot from 2022-12-11 20-18-11.png
Screenshot from 2022-12-11 20-18-11.png (206.47 KiB) Viewed 1588 times
Screenshot from 2022-12-11 20-18-28.png
Screenshot from 2022-12-11 20-18-28.png (201.66 KiB) Viewed 1588 times
Post Reply