Skip to content

Commit

Permalink
Arch: Partial fix for IFC export of precast elements
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jun 15, 2016
1 parent d05ac66 commit 79dcdfb
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/Mod/Arch/Arch.py
Expand Up @@ -61,3 +61,4 @@
from ArchServer import *
from ArchMaterial import *
from ArchSchedule import *
from ArchPrecast import *
6 changes: 6 additions & 0 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -352,6 +352,8 @@ def getSiblings(self,obj):

def getAxis(self,obj):
"Returns an open wire which is the axis of this component, if applicable"
if Draft.getType(obj) == "Precast":
return None
if obj.Base:
if obj.Base.isDerivedFrom("Part::Feature"):
if obj.Base.Shape:
Expand All @@ -378,6 +380,8 @@ def getAxis(self,obj):
def getProfiles(self,obj,noplacement=False):
"Returns the base profile(s) of this component, if applicable"
wires = []
if Draft.getType(obj) == "Precast":
return wires
n,l,w,h = self.getDefaultValues(obj)
if obj.Base:
if obj.Base.isDerivedFrom("Part::Extrusion"):
Expand Down Expand Up @@ -477,6 +481,8 @@ def getProfiles(self,obj,noplacement=False):
def getExtrusionVector(self,obj,noplacement=False):
"Returns an extrusion vector of this component, if applicable"
n,l,w,h = self.getDefaultValues(obj)
if Draft.getType(obj) == "Precast":
return FreeCAD.Vector()
if obj.Base:
if obj.Base.isDerivedFrom("Part::Extrusion"):
return FreeCAD.Vector(obj.Base.Dir)
Expand Down
12 changes: 11 additions & 1 deletion src/Mod/Arch/ArchPrecast.py
Expand Up @@ -44,7 +44,14 @@ def __init__(self,obj):
obj.addProperty("App::PropertyDistance","Height","Arch","The height of this element")
obj.addProperty("App::PropertyLinkList","Armatures","Arch","Armatures contained in this element")
obj.addProperty("App::PropertyVectorList","Nodes","Arch","The structural nodes of this element")
self.Type = "Structure"
self.Type = "Precast"
obj.Role = ["Beam","Column","Panel","Slab"]

def getProfile(self,obj,noplacement=True):
return []

def getExtrusionVector(self,obj,noplacement=True):
return FreeCAD.Vector()


class _PrecastBeam(_Precast):
Expand Down Expand Up @@ -1090,6 +1097,9 @@ def makePrecast(precasttype,length=0,width=0,height=0,slabtype="",chamfer=0,dent
obj.Height = height
obj.Chamfer = chamfer
obj.BeamBase = base
else:
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Precast")
_Precast(obj)
if FreeCAD.GuiUp:
_ViewProviderPrecast(obj.ViewObject)
return obj
Expand Down
42 changes: 21 additions & 21 deletions src/Mod/Arch/Resources/ui/preferences-ifc.ui
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>456</width>
<height>608</height>
<height>637</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -59,6 +59,26 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_6">
<property name="text">
<string>Create clones when objects have shared geometry</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ifcCreateClones</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -268,26 +288,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_6">
<property name="text">
<string>Create clones when objects have shared geometry</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ifcCreateClones</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/importIFC.py
Expand Up @@ -1077,7 +1077,7 @@ def export(exportList,filename):
if (not ifcprop) and hasattr(obj,"IfcAttributes"):
if obj.IfcAttributes:
ifcprop = True
if DEBUG : print(" adding ifc attributes")
#if DEBUG : print(" adding ifc attributes")
props = []
for key in obj.IfcAttributes:
if not (key in ["IfcUID","FlagForceBrep"]):
Expand Down

0 comments on commit 79dcdfb

Please sign in to comment.