If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)
Crash course on learning to manipulate IFCs with IfcOpenShell and Python
The wiki has a crash course :)
https://wiki.osarch.org/index.php?title=IfcOpenShell_code_examples
Comments
YESSSS! many thanks :)
The page now has some samples of the elusive "IFC selector / query syntax".
Especially this solves the problem of "how do you efficiently query a subset of IFC elements from a file". The results of this query can be fed into many things, such as:
@yorik - I hope it is interesting to you and maybe it can be used in FreeCAD too?
Very good for someone to get started and very good reference. Some hint: if a ifc is taken (uploaded with webget or even parsed directly from web) from a github account a new user even has a example to directly work with and exaclty see the same output as on the tutorial.
Furthermore a good reference. Sometimes I do not do any Python and ifc for a few weeks and thus some commands are just gone.
compiled latest 0.6 ifcopenshell but there is no ifcopenshell.util ? Do I need to compile 0.7 branch for this ?
Here
You need to compile it from git source or to download it from IfcOpenBot.
Just a mistake on wiki.
get_psets
is in element module notutil
directly ::-)
Very useful information!
I still remember that I knew @Moult because I was learning ifcopenshell-Python, and I contacted him by email to ask if he has more examples. He said that I could come to OSArch to communicate, so I came here.
get_psets does not support IfcComplexProperty. This is used to save properties of each material layer of a wall.
https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ifcpropertyresource/lexical/ifccomplexproperty.htm
file from here ... https://forum.freecadweb.org/viewtopic.php?t=14059&start=20#p123072
@bernd added support: https://github.com/IfcOpenShell/IfcOpenShell/commit/2a22acfdc936bc9ed6d2ff0ec36e76287da08d56
By the way, it's
ifc[345]
notifc[354]
.:-)
but if there are really some layers it misses some properties ...
up ... @Moult have you noticed the problem ?
@bernd it works for me, are you sure you have the latest file?
See my results:
Dion I musst somehow have been overwritten the file on FreeCAD (if I am at my computer at work I only use downloadable FreeCAD version which includes ifcopenshell) update ... works great here too.
Is there a special reason why you did not make it work this way?
f[437].get_psets()
@bernd I guess we just started collecting functions and haven't yet started to organise them better.
But for this one, I agree it totally makes sense :) Perhaps post a comment in the Github issue and ask @aothms what his thoughts are?
https://github.com/IfcOpenShell/IfcOpenShell/issues/829#issuecomment-670489327