IFC in Sketchup

This forum section is only for IFC-related issues
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

IFC in Sketchup

Post by yorik »

Sketchup found a quite interesting way to begin to work with IFC:
http://sketchupdate.blogspot.com.br/201 ... tchup.html
http://help.sketchup.com/en/article/3000038

Of course it is pretty simple, you define a component, you give it a type (which can be loaded from a schema), and that type can have properties, which you can fill in. But the simplicity of this is also a strength.

We might think to something similar... A bit like the "Role" property of Arch Structures, but extend it to all Arch objects. IfcOpenshell already has a couple of tools, for example to get all properties supported by a certain IFC type. And with the PropertyMap we'd have an easy way to set these properties...

Anyway, food for thought.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

Yeah, the properties are exactly what I'm after in FreeCAD. Because in FreeCAD I am able to make lots of funny things having the imported geometry the properties and the strengths of python.

As far as I know there is no "big Arch object" in FreeCAD which is above all others in which properties for all Arch object could be defined. Currently properties must be defined in any Arch object again. Have you ever been thinking of such an object.

bernd
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC in Sketchup

Post by yorik »

Actually, internally yes. All "solid" Arch objects (that is, all arch objects that become real building pieces, not the "visual" ones like axes) are derived from a "base" object called Arch Component. Several behaviours (such as the Additions / Subtractions mechanism) are implemented in the ArchComponent, so they are inherited by all Arch objects. Of course the idea is to use that as much as possible (for example I'll implement the materials there too).

I'm thinking since yesterday to that sketchup way... In sketchup it makes much sense because objects are very simple (I'm actually curious as how they export their meshes to IFC), so adding a very simple IFC layer like they did works well... I'm in doubt with what to do in freecad, because the arch WB already "orient" things a lot, which would ideally allow you to forget a bit about the complex IFC structure (I also see that in sketchup things are pretty limited, all the complexity of IFC being in the "relations" you make between elements, and apparently this is not supported ATM.

Anyway, of course any decent IFC exporting app must allow you to access and tweak the whole array of IFC properties... We must attack that at some point.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

yorik wrote:Actually, internally yes. All "solid" Arch objects (that is, all arch objects that become real building pieces, not the "visual" ones like axes) are derived from a "base" object called Arch Component. Several behaviours (such as the Additions / Subtractions mechanism) are implemented in the ArchComponent, so they are inherited by all Arch objects. Of course the idea is to use that as much as possible (for example I'll implement the materials there too).
I was exactly thinking of such object. Yorik, I just should spend more time reading your code :roll: I've been defining my properties in wall AND structure. I could have defined my own properties in ArchComponent. It ist just straigth forward and fail-safe.
yorik wrote:Anyway, of course any decent IFC exporting app must allow you to access and tweak the whole array of IFC properties... We must attack that at some point.
+1

Do you know how do I access the properties of an Entity (obj)? The only properties I'm able to access are id, name and type. I try to use ifcopenshell directly but had no success as well. In Allplan I can define as much properties as I want. They are user defined. Solibri viewer does read this user defined properties. I would like to have them in a dictionary in FreeCAD.

bernd

EDIT
started to use git for my own FreeCAD stuff :D https://github.com/berndhahnebach/FreeC ... s/ifcprop1
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

Attached some simple example file. Just a wall. It has dozens of Attributs. I attached a scree in original resolution because of the little script size.

EDIT:
Spitted the pictures in to 2
Attachments
screen1.jpg
screen1.jpg (50.51 KiB) Viewed 7515 times
screen.jpg
screen.jpg (86.3 KiB) Viewed 7515 times
export.ifc
(10.82 KiB) Downloaded 281 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

JFYI: I made a post in the IfcOpenShell Forum regarding the property access. https://sourceforge.net/p/ifcopenshell/ ... it=25#77ed
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC in Sketchup

Post by yorik »

Great!
ne thing I've been thinking, is using the new PropertyMap in Arch objects (the same that is used for materials), it's a simple dictionary key:value, we could have one of those to store custom ifc properties. So you could really override anything for any Arch object. If we can access the schema as in your post, we could have a kind of custom editor for it...

This is actually anotherinteresting idea (custom editors for PropertyMap). I'll make another thread...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

yorik wrote:Great!
ne thing I've been thinking, is using the new PropertyMap in Arch objects (the same that is used for materials), it's a simple dictionary key:value, we could have one of those to store custom ifc properties. So you could really override anything for any Arch object. If we can access the schema as in your post, we could have a kind of custom editor for it...

This is actually anotherinteresting idea (custom editors for PropertyMap). I'll make another thread...
It ist exactly what I allready did a few days ago ... https://github.com/berndhahnebach/FreeC ... 28214dce1a I only still miss to access the properties. But we'll see what Thomas says ...

Yeah, some editor would be really cool.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

got an idea how to import the properties. I'll see if I can came up with something useable ...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC in Sketchup

Post by bernd »

Started to do some property import. The only way I found to access the values in the entities is using the function get.argument()

For the relations instead get.argumet() you used getAttr(r,"RelatingObject"), getAttr(r,"RelatingStructure"), getAttr(r,"RelatedOpeningElement") ... I could not figure out how they do work? lines 160 to 170 in importIFC.py

btw, thanks for information regarding ifcimport.

bernd
Post Reply