Arch: misc bugfixes in IFC export
This commit is contained in:
parent
007f939731
commit
627e32aa2c
|
@ -483,7 +483,7 @@ def meshToShape(obj,mark=True,fast=True,tol=0.001,flat=False,cut=True):
|
||||||
FreeCAD.ActiveDocument.removeObject(name)
|
FreeCAD.ActiveDocument.removeObject(name)
|
||||||
newobj = FreeCAD.ActiveDocument.addObject("Part::Feature",name)
|
newobj = FreeCAD.ActiveDocument.addObject("Part::Feature",name)
|
||||||
newobj.Shape = solid
|
newobj.Shape = solid
|
||||||
newobj.Placement = plac
|
#newobj.Placement = plac #the placement is already computed in the mesh
|
||||||
if (not solid.isClosed()) or (not solid.isValid()):
|
if (not solid.isClosed()) or (not solid.isValid()):
|
||||||
if mark:
|
if mark:
|
||||||
newobj.ViewObject.ShapeColor = (1.0,0.0,0.0,1.0)
|
newobj.ViewObject.ShapeColor = (1.0,0.0,0.0,1.0)
|
||||||
|
|
|
@ -514,7 +514,13 @@ class _Roof(ArchComponent.Component):
|
||||||
self.baseface = None
|
self.baseface = None
|
||||||
|
|
||||||
base = None
|
base = None
|
||||||
if obj.Base and obj.Angles:
|
if obj.Base:
|
||||||
|
if not obj.Angles:
|
||||||
|
if obj.Base.isDerivedFrom("Part::Feature"):
|
||||||
|
if obj.Base.Shape.Solids:
|
||||||
|
base = obj.Base.Shape.copy()
|
||||||
|
print "base", base
|
||||||
|
else:
|
||||||
w = None
|
w = None
|
||||||
if obj.Base.isDerivedFrom("Part::Feature"):
|
if obj.Base.isDerivedFrom("Part::Feature"):
|
||||||
if (obj.Base.Shape.Faces and obj.Face):
|
if (obj.Base.Shape.Faces and obj.Face):
|
||||||
|
|
|
@ -543,19 +543,23 @@ def export(exportList,filename):
|
||||||
props = []
|
props = []
|
||||||
for key in obj.IfcAttributes:
|
for key in obj.IfcAttributes:
|
||||||
if not (key in ["IfcUID","FlagForceBrep"]):
|
if not (key in ["IfcUID","FlagForceBrep"]):
|
||||||
tp,val = obj.IfcAttributes[key].strip(")").split("(")
|
r = obj.IfcAttributes[key].strip(")").split("(")
|
||||||
|
tp = r[0]
|
||||||
|
val = "(".join(r[1:])
|
||||||
val = val.strip("'")
|
val = val.strip("'")
|
||||||
val = val.strip('"')
|
val = val.strip('"')
|
||||||
if tp == "IfcLabel":
|
if DEBUG: print " property ",key," : ",str(val), " (", str(tp), ")"
|
||||||
|
if tp in ["IfcLabel","IfcText","IfcIdentifier"]:
|
||||||
val = str(val)
|
val = str(val)
|
||||||
elif tp == "IfcBoolean":
|
elif tp == "IfcBoolean":
|
||||||
if val == ".T.":
|
if val == ".T.":
|
||||||
val = True
|
val = True
|
||||||
else:
|
else:
|
||||||
val = False
|
val = False
|
||||||
|
elif tp == "IfcInteger":
|
||||||
|
val = int(val)
|
||||||
else:
|
else:
|
||||||
val = float(val)
|
val = float(val)
|
||||||
if DEBUG: print " property ",key," : ",str(val), " (", str(tp), ")"
|
|
||||||
props.append(ifcfile.createIfcPropertySingleValue(str(key),None,ifcfile.create_entity(str(tp),val),None))
|
props.append(ifcfile.createIfcPropertySingleValue(str(key),None,ifcfile.create_entity(str(tp),val),None))
|
||||||
if props:
|
if props:
|
||||||
pset = ifcfile.createIfcPropertySet(ifcopenshell.guid.compress(uuid.uuid1().hex),history,'PropertySet',None,props)
|
pset = ifcfile.createIfcPropertySet(ifcopenshell.guid.compress(uuid.uuid1().hex),history,'PropertySet',None,props)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user