IFC export doesn't work at all

This forum section is only for IFC-related issues
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export doesn't work at all

Post by bernd »

@benni:
could you test this:
geht_nicht_muss_aber.ifc
(471.76 KiB) Downloaded 84 times
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC export doesn't work at all

Post by yorik »

Benni wrote:File "C:\..........\Mod\Arch\importIFC.py", line 1309 in getRepresentation
if not isintance(e.Curve,Part.Line):"
I think the culprit is this line, IIRC there are still some edge types that are not fully implemented in python, and that yield an error when you try to access their Curve property. I'll try to change it (I think I made a DraftGeomUtils function as a workaround to that problem some time ago)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export doesn't work at all

Post by bernd »

yorik wrote:
Benni wrote:File "C:\..........\Mod\Arch\importIFC.py", line 1309 in getRepresentation
if not isintance(e.Curve,Part.Line):"
I think the culprit is this line, IIRC there are still some edge types that are not fully implemented in python, and that yield an error when you try to access their Curve property.
Yes it is. But the edges might be broken.? They do not show up at Part.show()

Attached some code lines to reproduce the error:

Code: Select all

obj = App.ActiveDocument.getObject("Part__Feature460")
for e in obj.Shape.Edges:
    if not isinstance(e.Curve,Part.Line):
        print e , '   ', e.Vertexes
and including a try except to see the edges:

Code: Select all

obj = App.ActiveDocument.getObject("Part__Feature460")
for e in obj.Shape.Edges:
    try:
        if not isinstance(e.Curve,Part.Line):
            pass
    except:
        print 'Undefined Curve Type:  ', e, '   ', e.Vertexes
        Part.show(e)

@Benni:
If you are interested. Load the file you posted onto FreeCAD. Click on "select all" here in the forum above the code, copy and paste the code in the FreeCAD python console.
yorik wrote: I'll try to change it (I think I made a DraftGeomUtils function as a workaround to that problem some time ago)
great. Could the error be because the edges are broken? They do not show up at Part.show?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export doesn't work at all

Post by bernd »

bernd wrote:@benni:
could you test this:
geht_nicht_muss_aber_2.ifc
(192.41 KiB) Downloaded 70 times
If this is imported back into FreeCAD the BOP check still has some problems, but this ifc could be imported into Nemetschek Allplan. Allplan seams to have some smart routines at import to get rid of precession problems. If it is exported from Allplan again the triangulation is changed from Allplan. Finaly resulting in a valid errorfree ifc for use in Allplan or FreeCAD :)
geht_nicht_muss_aber_2.ifc
(192.41 KiB) Downloaded 70 times
EDIT: damn it still has lots of BOP errors in FreeCAD, but it is fine in Allplan, IFCPP and other viewer ...
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC export doesn't work at all

Post by yorik »

bernd wrote:Yes it is. But the edges might be broken?
I don't know, but it's strange that Part.show would silently skip wrong edges. Usually you would get an error... In any case I'll look into this a bit further when I have a moment, there might be some quick fixes possible...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export doesn't work at all

Post by bernd »

FreeCAD is getting better and better. step-import and ifc-export. Besides some minior issues (I'm gone make a separate thread about them) with colors it worked very well.
Attachments
screen.png
screen.png (211.48 KiB) Viewed 1377 times
Post Reply