Skip to content

Commit

Permalink
Arch: Better IFC export of walls
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Apr 16, 2014
1 parent 5d5ed94 commit 39d0657
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Arch/ifcWriter.py
Expand Up @@ -435,15 +435,18 @@ def _relate(self,container,entities):
else:
create(self._fileobject,"IfcRelAggregates",[uid(),self._owner,'Relationship','',container,entities])

def addWall(self,shapes,storey=None,placement=None,name="Default wall",description=None):
def addWall(self,shapes,storey=None,placement=None,name="Default wall",description=None,standard=False):
"""addWall(shapes,[storey,placement,name,description]): creates a wall from the given representation shape(s)"""
if not placement:
placement = self.addPlacement()
if not isinstance(shapes,list):
shapes = [shapes]
reps = [create(self._fileobject,"IfcShapeRepresentation",[self._repcontext,'Body','SweptSolid',[shape]]) for shape in shapes]
prd = create(self._fileobject,"IfcProductDefinitionShape",[None,None,reps])
wal = create(self._fileobject,"IfcWallStandardCase",[uid(),self._owner,name,description,None,placement,prd,None])
if standard:
wal = create(self._fileobject,"IfcWallStandardCase",[uid(),self._owner,name,description,None,placement,prd,None])
else:
wal = create(self._fileobject,"IfcWall",[uid(),self._owner,name,description,None,placement,prd,None])
self.BuildingProducts.append(wal)
if not storey:
if self.Storeys:
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/importIFC.py
Expand Up @@ -976,7 +976,7 @@ def export(exportList,filename):
if parent:
parent = ifc.findByName("IfcBuildingStorey",str(parent.Label))
if gdata:
ifc.addWall( ifc.addExtrudedPolyline(gdata[0],gdata[1]), storey=parent, name=name )
ifc.addWall( ifc.addExtrudedPolyline(gdata[0],gdata[1]), storey=parent, name=name, standard=True )
elif fdata:
ifc.addWall( [ifc.addFacetedBrep(f) for f in fdata], storey=parent, name=name )

Expand Down

0 comments on commit 39d0657

Please sign in to comment.