[IFC Export] Problems with IFC (structural view) export

Feels good to take part to the party :smiley:
I’m absolutly aware that for now I’m scratching the surface … hopefully my future time constraints will allow me to digg a little deeper.

Thank you @Bernd

I finally managed it to export slabs as structural surfaces with their thickness information to IFC (structural view).
Now this changes make it possible to export a quite usefull IFC model for further processing to a dedicated structural analysis software (see following image).
test_structute.jpg
Unfortunately walls don’t work ATM because they miss a node system like other structural elements. A possible workaround for this problem is to model them as slabs.
Next steps to improve this workflow could be:

  • add nodes to walls
  • improve node manipulations tools for structural elements
  • export material informations for structural elements (if available)
  • export profile information for beams and columns

Soon I will submit a pull request with my changes for slabs.
Cheers

EDIT: Pull request: https://github.com/FreeCAD/FreeCAD/pull/4823
test_structure.ifc (47.7 KB)
test_structure.FCStd (58.5 KB)

If I open the ifc attache, only the columns are structural curve member. The slabs are Structural Curve Connections. Should not they be IfcStructuralSurfaceMember

srceen1.png
srceen2.png

Hi @Bernd,
thank you for testing.

Indeed here something goes wrong …
For my understanding along the StructuralCurveMembers and along the edges of the IfcStructuralSurfaceMember(s) there should be StructuralCurveConnection(s) in order to be able to connect a beam-element to a shell-element or a shell-element to another shell-element.
This seems to work, but your BIM viewer can’t show the IfcStructuralSurfaceMember(s) I wrote (maybe doing something wrong) to the IFC file.

#513=IFCSTRUCTURALSURFACEMEMBER('1ZH_1DNCz7gROKDH8p2Acf',#5,'Slab001',$,$,#25,#512,.SHELL.,0.35);

I imported the IFC file to RFEM and here I can see the IfcStructuralSurfaceMember(s) with their correct thickness property.

Mhh .. that’s strange … I will have to investigate further :question:

In the meantime I found this post:
https://forum.freecadweb.org/viewtopic.php?t=16801#p133263
and maybe it’s related to my issue since I have focused strongly on RFEM created structural analysis view IFC-files because my goal was to read them with RFEM.
Will come back when I have some news :slight_smile:

EDIT: I think I’m close to the solution. If I export a slab with Z=0.0 to IFC and reimport it back then a surface is shown wherelse if I do the same with Z<>0.0 then only the surface edges are imported. This could indicate the problem described above. I will try to patch my code and see if I’m right :wink:
BTW @Bernd, could you advice me how best to fix my pull request, or take it back and start a new one?

Thanks for your appreciated help!

it is a pity rusterlw has never seen here again …

In the regard of your pull request. I am fine with it anyway but if you would like to do it anyway … You just need to change the commits and push it to the branch you used for the PR. Means any change on this branch on your github will change the PR. The leads to the question how to change the commits. Threre are various workflows to archive this with git. Best ist to play with interactive rebase. But be careful do not make it on the PR branch. Make a new branch play with interactive rebase and if you are happy with the new history you could force push it to the PR branch. If you have any questions there are just ask …

But as said do not to much time with it. Better improve the export … :smiley:

Aha means may be my viewer is wrong. Could be too. I have not tried any other viewer, neither I did have a look at the ifc. I will investigate too.

I think you can stop investigating :smiley:
I’m quite sure I was right with my assumptions and the culprit is the above mentioned issue.
I patched my code and exported a new IFC file although i still have a problem for vertical walls.
Can you please test it with your IFC viewer and let me know?
Cheers
test_structure_new.ifc (46.4 KB)

Hi @Bernd,

I hopefully solved the mentioned problems for the IFC export of slabs.
The code now should work for horizontal, vertical (walls) and inclined (ramps) slabs. :confused:
Can you give me please some feedback before I will try to repair my corresponding pull request?

One more favor: since my next plan is to write out material information data to IFC: could you point me where I can find how to access all material objects of a FreeCad model and the material property of a single FreeCad object?
Thanks for your help!
test_structure_with_stairs.ifc (51.5 KB)
test_structure_with_stairs.FCStd (63.1 KB)

in the regard of material:

ATM only Arch Components (thus all Arch Objects) do have a property called Material. You can acces it like any other property. This property is a link to a material object. This material object does have a property “Material” which is a dictionary with all the data inside. This looks like this:

>>> 
>>> App.ActiveDocument.getObjectsByLabel("CalculiX-Steel")[0].Material
{'AuthorAndLicense': 'CalculiX-Steel', 'CardName': 'CalculiX-Steel', 'Color': '(0.8, 0.8, 0.8, 1.0)', 'Density': '7900 kg/m^3', 'Description': 'Standard steel material for CalculiX sample calculations', 'DiffuseColor': '(0.8, 0.8, 0.8, 1.0)', 'Father': 'Metal', 'Name': 'CalculiX-Steel', 'PoissonRatio': '0.3', 'ProductURL': '', 'SectionColor': '(0.8, 0.8, 0.8, 1.0)', 'SpecificHeat': '590 J/kg/K', 'StandardCode': '', 'ThermalConductivity': '43 W/m/K', 'ThermalExpansionCoefficient': '0.000012 m/m/K', 'Transparency': '0', 'ViewColor': '(0.8, 0.8, 0.8, 1.0)', 'YoungsModulus': '210000 MPa'}
>>>

in the regard of material:

ATM only Arch Components (thus all Arch Objects) do have a property called Material. You can acces it like any other property. This property is a link to a material object. This material object does have a property “Material” which is a dictionary with all the data inside. This looks like this:

>>> 
>>> App.ActiveDocument.Component.Material.Name
'Material'
>>> App.ActiveDocument.Component.Material.Label
'CalculiX-Steel'
>>> 
>>> 
>>> App.ActiveDocument.getObjectsByLabel("CalculiX-Steel")[0].Material
{'AuthorAndLicense': 'CalculiX-Steel', 'CardName': 'CalculiX-Steel', 'Color': '(0.8, 0.8, 0.8, 1.0)', 'Density': '7900 kg/m^3', 'Description': 'Standard steel material for CalculiX sample calculations', 'DiffuseColor': '(0.8, 0.8, 0.8, 1.0)', 'Father': 'Metal', 'Name': 'CalculiX-Steel', 'PoissonRatio': '0.3', 'ProductURL': '', 'SectionColor': '(0.8, 0.8, 0.8, 1.0)', 'SpecificHeat': '590 J/kg/K', 'StandardCode': '', 'ThermalConductivity': '43 W/m/K', 'ThermalExpansionCoefficient': '0.000012 m/m/K', 'Transparency': '0', 'ViewColor': '(0.8, 0.8, 0.8, 1.0)', 'YoungsModulus': '210000 MPa'}
>>>

Just ask if you need further information …

Thank you @Bernd for your assistance.
As a newbie I often struggle with the simplest things so your help means a lot to me :smiley:
Unfortunately the material stuff has to wait a little more.
Bevor that I want to finalize the export of IfcStructuralSurfaceMember. Here I encountered some more problems that may be related to the IFC version. Usually I exported in IFC4, but as you already have noticed some Viewer (i.e. BIMcollab ZOOM) don’t import the surfaces … but if I change the line

FILE_SCHEMA=(('IFC4'))

to

FILE_SCHEMA=(('IFC2X3'))

by hand in the output file everything works like a charme :question:
So I tried to export directly to IFC2X3 by setting the corresponding IFC-version option in the ARCH preferences … as a result i got a lot of console errors.
By learning the code I fixed this errors. Here is my pull request: https://github.com/FreeCAD/FreeCAD/pull/4831#issue-661278951
I think it should be merged before I continue with the IfcStructuralSurfaceMember stuff.
Cheers

I did some further testing for my IFC export of StructuralSurfaceMembers :confused:
Now that IFC2x3 should work in FreeCAD I exported my test model test_structure_with_stairs_SurfaceMember.FCStd to IFC2X3 and IFC4 (test_structure_with_stairs_SurfaceMember_IFC2X3.ifc, test_structure_with_stairs_SurfaceMember_IFC4.ifc) and loaded them with some for me avialable software
What I see is:
IFC_imports_comparision.jpg

  • all imports work without error messages
  • FreeCad imports all geometries correctly
  • RFEM imports all geometries correctly too
  • BIMcollab ZOOM shows some problems with StructuralSurfaceMembers for IFC4
  • wikiifc viewer shows problems with StructuralCurveMembers for IFC2X3 and IFC4
  • Goat viewer shows problems with StructuralCurveMembers for IFC2X3 and nothing at all for IFC4

Now I’m quite confused. What do you think @Bernd? Should I still go for a pull request or should we investigate further?
Thanks in advance for your valuable advice! :smiley:
test_structure_with_stairs_SurfaceMember.FCStd (67.7 KB)
test_structure_with_stairs_SurfaceMember_IFC4.ifc (18.2 KB)
test_structure_with_stairs_SurfaceMember_IFC2X3.ifc (18.1 KB)

By the way, here is the output from the BlenderBIM Add-on for the IFC4 file. Hopefully its ability to inspect some of the more native IFC capbilities helps debug and discover issues. Let me know if you’d like to check any properties :slight_smile:

This work is largely done by Jesusbill who you can find on the community.osarch.org forums :slight_smile:
2021-06-07-165553_424x532_scrot.png

Thank you @Moult for showing me this possibility :wink:

I’m very glad to see that BenderBIM imports all StructuralCurveMember and StructuralSurfaceMember geometries together with their thickness, and this for IFC2X3 and IFC4. I would say: And the winner is … :smiley:
For the sake of completeness I’ve added BlenderBIM to my previous comparision table:
BlenderBim_IFC_import.jpg
Reassured by this result I think it would make sense to re-submit a pull request with my latest improvements.
If changes should be necessary, they still could be made in the future!

Kind regards

I will get in contact with the support.

another viewer is http://view.ifcopenshell.org I try all the time … It is a viewer for the library FreeCAD and BlenderBIM are based on.

Hey @balrobs fantastic work, great to see this development in FreeCAD.
I have downloaded your file and want to try import it in Code_Aster with ifc2ca scripts, will report back here.

As @Moult said we have been working on structural stuff in BlenderBIM, let’s keep in touch, it would be nice to push forward related developments in both software!

Keep up the great work!

Thank you for your kind words @Jesusbill and welcome here in the forum :slight_smile:

Unfortunatly I’m not an instructed developer but only a hobbiest who tries to learn a lot of new things (FreeCAD, Python and IFC) in order to improve the actual IFC export of FreeCAD. Therefore, my progress is slow and certainly does not have the best quality :mrgreen:

In the last few weeks I found your mentioned scripts on github and took a lot of inspiration while learning from them. I know I still have to learn a lot .. so I would be very happy to keep in touch and help bundle synergies between FreeCAD and BlenderBim.

Kind regards

3cdccea9d62a