IFC import, treat FreeCAD, King_merged
Re: IFC import
hehe wow... impressive!
We should really think a bit about how to manage all the complexity of those rich IFC models... I'm usually not very satisfied with the dumb and too rigid Building->Floor->Objects hierarchy of ifc...
We should really think a bit about how to manage all the complexity of those rich IFC models... I'm usually not very satisfied with the dumb and too rigid Building->Floor->Objects hierarchy of ifc...
Re: IFC import
+1 All the elemets in ifc-files have lots of attributes which could be used to filter. At least the ifcbuildingelement itself.yorik wrote:... I'm usually not very satisfied with the dumb and too rigid Building->Floor->Objects hierarchy of ifc...
To be honest, currently I'm happy if ALL elemtes are imported without errors. By the way since the model is downloaded from the internet the screenshots may be used somewhere.
Last edited by bernd on Thu Dec 12, 2013 10:37 pm, edited 1 time in total.
Re: IFC import
I allready tried that option but for me it doesn't make any difference at all.yorik wrote:the first hing it already does. You must enable debug messages in Arch IFC preferences options
Re: IFC import
On my FreeCAD latest from source the debugmessages are shown only if a ifc is opend from pythonkonsole usingberndhahnebach wrote:I allready tried that option but for me it doesn't make any difference at all.yorik wrote:the first hing it already does. You must enable debug messages in Arch IFC preferences options
Code: Select all
importIFC.open(file)
Re: IFC import
Ah, maybe you must activate the "redirect python output" by right-clicking on the output window...
Re: IFC import
yorik wrote:Ah, maybe you must activate the "redirect python output" by right-clicking on the output window...
How about some little update in importIFC.py?
Code: Select all
hugo@weide:~/Documents/projekte--ifc/freecad/development/snapshot/free-cad-code/build$ diff Mod/Arch/importIFC.py ../src/Mod/Arch/importIFC.py
151c151
< nobj = makeStructure(obj.id,obj.type,shape,n)
---
> nobj = makeStructure(obj.id,shape,n)
396c396
< def makeStructure(entity,ifctype,shape=None,name="Structure"):
---
> def makeStructure(entity,shape=None,name="Structure"):
409,417c409
< if ifctype == "IfcBeam":
< structure.Role = "Beam"
< elif ifctype == "IfcColumn":
< structure.Role = "Column"
< elif ifctype == "IfcSlab":
< structure.Role = "Slab"
< elif ifctype == "IfcFooting":
< structure.Role = "Foundation"
< if DEBUG: print "made structure object ",entity,":",structure," IfcBuildingElement ",ifctype
---
> if DEBUG: print "made structure object ",entity,":",structure
419d410
<
Re: IFC import
and this one:
Code: Select all
diff Mod/Arch/ArchWall.py ../src/Mod/Arch/ArchWall.py
33,36d32
< # Possible roles
< Roles = ["Wall"]
<
<
64d59
< obj.Role = "Wall"
395,396d389
< obj.addProperty("App::PropertyEnumeration","Role","Arch",
< str(translate("Arch","The role of this structural element")))
403d395
< obj.Role = Roles
Re: IFC import
Thanks! I added you first changes. The wall roles I didn't, because I prefer not to add things that have no real reason to exist yet... At the moment it's very easy to convert a wall to struct or vice-versa, so I think the current needs (for example structural walls) are fulfilled. If we find a reason to have roles for walls, I add it.
Next time, if you want to see your name in the official freecad commits (and therefore become an official freecad developer), think about making a git branch
Next time, if you want to see your name in the official freecad commits (and therefore become an official freecad developer), think about making a git branch
Re: IFC import
One more reason to use git.yorik wrote:Next time, if you want to see your name in the official freecad commits (and therefore become an official freecad developer), think about making a git branch
I would like to do mass calculation of different elements. Really simple example.yorik wrote:...The wall roles I didn't, ... If we find a reason to have roles for walls, I add it.
Code: Select all
beam = 0
column = 0
foundation = 0
slab = 0
wall = 0
for o in objectlist:
if hasattr(o,'Role'):
if o.Role == 'Beam':
beam += 1
elif o.Role == 'Column':
column += 1
elif o.Role == 'Foundation':
foundation += 1
elif o.Role == 'Slab':
slab += 1
elif o.Role == 'Wall':
wall +=1
print('Folgende Elemente gefunden:')
print('Beam', beam)
print('Column', column)
print('Foundation', foundation)
print('Slab', slab)
print('Wall', wall)
print('Sum', beam+column+foundation+slab+wall)
print('')
- Attachments
-
- screen.jpg (57.23 KiB) Viewed 3534 times
Re: IFC import
gave this huge file (see first topic post) another try in FreeCAD but it failed to import the file
I played with python but I'm not able to find a shape I'm able to import. There must be something strange has happened ...
I can try any IfcProduct. I get no brep ...
I played with python but I'm not able to find a shape I'm able to import. There must be something strange has happened ...
Code: Select all
ifcfile = '/home/hugo/Desktop/210_King_Merged.ifc'
import ifcopenshell, os
import Part
from ifcopenshell import geom
settings = ifcopenshell.geom.settings()
settings.set(settings.USE_BREP_DATA,True)
settings.set(settings.SEW_SHELLS,True)
settings.set(settings.USE_WORLD_COORDS,True)
f = ifcopenshell.open(ifcfile)
f.by_type('IfcPerson')
f.by_type('IfcBuildingElementProxy')
p = f.by_id(3213449)
r = p.Representation
print p, '\n', r
cr = ifcopenshell.geom.create_shape(settings, p)