Arch: Partial fix for IFC export of precast elements
This commit is contained in:
@@ -61,3 +61,4 @@ from ArchCutPlane import *
|
||||
from ArchServer import *
|
||||
from ArchMaterial import *
|
||||
from ArchSchedule import *
|
||||
from ArchPrecast import *
|
||||
|
||||
@@ -352,6 +352,8 @@ class Component:
|
||||
|
||||
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:
|
||||
@@ -378,6 +380,8 @@ class Component:
|
||||
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"):
|
||||
@@ -477,6 +481,8 @@ class Component:
|
||||
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)
|
||||
|
||||
@@ -44,7 +44,14 @@ class _Precast(ArchComponent.Component):
|
||||
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):
|
||||
@@ -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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>456</width>
|
||||
<height>608</height>
|
||||
<height>637</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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"]):
|
||||
|
||||
Reference in New Issue
Block a user