Arch: All Arch objects can now have any IFC type(role)

This commit is contained in:
Yorik van Havre
2018-05-10 10:42:06 -03:00
parent b3fb790d54
commit b5ffabace2
12 changed files with 8 additions and 26 deletions

View File

@@ -29,7 +29,8 @@ __url__ = "http://www.freecadweb.org"
Roles = ['Undefined','Beam','Chimney','Column','Covering','Curtain Wall',
'Door','Foundation','Furniture','Hydro Equipment','Electric Equipment',
'Member','Plate','Railing','Ramp','Ramp Flight','Rebar','Pile','Roof','Shading Device','Slab','Space',
'Stair','Stair Flight','Tendon','Wall','Wall Layer','Window']
'Stair','Stair Flight','Tendon','Wall','Wall Layer','Window','Pipe Segment','Curtain Wall',
'Pipe Fitting','Reinforcing Bar']
import FreeCAD,Draft,ArchCommands,math
from FreeCAD import Vector

View File

@@ -51,9 +51,6 @@ else:
# Equipment is used to represent furniture and all kinds of electrical
# or hydraulic appliances in a building
# presets
Roles = ["Undefined","Furniture", "Hydro Equipment", "Electric Equipment"]
def makeEquipment(baseobj=None,placement=None,name="Equipment"):
"makeEquipment([baseobj,placement,name]): creates an equipment object from the given base object."
@@ -269,7 +266,6 @@ class _Equipment(ArchComponent.Component):
obj.addProperty("App::PropertyVectorList","SnapPoints","Arch",QT_TRANSLATE_NOOP("App::Property","Additional snap points for this equipment"))
obj.addProperty("App::PropertyFloat","EquipmentPower","Arch",QT_TRANSLATE_NOOP("App::Property","The electric power needed by this equipment in Watts"))
self.Type = "Equipment"
obj.Role = Roles
obj.Role = "Furniture"
obj.Proxy = self
obj.setEditorMode("VerticalArea",2)

View File

@@ -48,9 +48,6 @@ __title__="FreeCAD Arch Frame"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
# Possible roles for frames
Roles = ['Undefined','Covering','Member','Railing','Shading Device','Tendon']
def makeFrame(baseobj,profile,name=translate("Arch","Frame")):
"""makeFrame(baseobj,profile,[name]): creates a frame object from a base sketch (or any other object
containing wires) and a profile object (an extrudable 2D object containing faces or closed wires)"""
@@ -109,7 +106,6 @@ class _Frame(ArchComponent.Component):
obj.addProperty("App::PropertyBool","Fuse","Arch",QT_TRANSLATE_NOOP("App::Property","If true, geometry is fused, otherwise a compound"))
self.Type = "Frame"
obj.Align = True
obj.Role = Roles
obj.Role = "Railing"
obj.Edges = ["All edges","Vertical edges","Horizontal edges","Bottom horizontal edges","Top horizontal edges"]

View File

@@ -369,6 +369,7 @@ class _Panel(ArchComponent.Component):
obj.addProperty("App::PropertyVector","Normal","Arch",QT_TRANSLATE_NOOP("App::Property","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)"))
obj.Sheets = 1
self.Type = "Panel"
obj.Role = "Plate"
obj.WaveType = ["Curved","Trapezoidal","Spikes"]
obj.FaceMaker = ["None","Simple","Cheese","Bullseye"]
obj.setEditorMode("VerticalArea",2)

View File

@@ -185,7 +185,7 @@ class _ArchPipe(ArchComponent.Component):
ArchComponent.Component.__init__(self,obj)
self.Type = "Pipe"
obj.Role = ["Pipe Segment"]
obj.Role = "Pipe Segment"
obj.addProperty("App::PropertyLength", "Diameter", "Arch", QT_TRANSLATE_NOOP("App::Property","The diameter of this pipe, if not based on a profile"))
obj.addProperty("App::PropertyLength", "Length", "Arch", QT_TRANSLATE_NOOP("App::Property","The length of this pipe, if not based on an edge"))
obj.addProperty("App::PropertyLink", "Profile", "Arch", QT_TRANSLATE_NOOP("App::Property","An optional closed profile to base this pipe on"))
@@ -299,7 +299,7 @@ class _ArchPipeConnector(ArchComponent.Component):
ArchComponent.Component.__init__(self,obj)
self.Type = "PipeConnector"
obj.Role = ["Pipe Fitting"]
obj.Role = "Pipe Fitting"
obj.addProperty("App::PropertyLength", "Radius", "Arch", QT_TRANSLATE_NOOP("App::Property","The curvature radius of this connector"))
obj.addProperty("App::PropertyLinkList", "Pipes", "Arch", QT_TRANSLATE_NOOP("App::Property","The pipes linked by this connector"))
obj.addProperty("App::PropertyEnumeration", "ConnectorType", "Arch", QT_TRANSLATE_NOOP("App::Property","The type of this connector"))

View File

@@ -170,6 +170,7 @@ class _Rebar(ArchComponent.Component):
obj.addProperty("App::PropertyDistance", "Length", "Arch", QT_TRANSLATE_NOOP("App::Property","Length of a single rebar"))
obj.addProperty("App::PropertyDistance", "TotalLength", "Arch", QT_TRANSLATE_NOOP("App::Property","Total length of all rebars"))
self.Type = "Rebar"
obj.Role = "Reinforcing Bar"
obj.setEditorMode("Spacing", 1)
obj.setEditorMode("Length", 1)
obj.setEditorMode("TotalLength", 1)

View File

@@ -182,6 +182,7 @@ class _Roof(ArchComponent.Component):
obj.addProperty("App::PropertyLength","BorderLength","Arch", QT_TRANSLATE_NOOP("App::Property","The total length of borders of this roof"))
obj.addProperty("App::PropertyBool","Flip","Arch",QT_TRANSLATE_NOOP("App::Property","Flip the roof direction if going the wrong way"))
self.Type = "Roof"
obj.Role = "Roof"
obj.Proxy = self
obj.setEditorMode("RidgeLength",1)
obj.setEditorMode("BorderLength",1)

View File

@@ -27,8 +27,6 @@ __title__="FreeCAD Arch Space"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
Roles = ["Undefined","Space"]
SpaceTypes = [
"Undefined",
"Exterior",
@@ -268,7 +266,6 @@ class _Space(ArchComponent.Component):
self.Type = "Space"
obj.SpaceType = SpaceTypes
obj.Conditioning = ConditioningTypes
obj.Role = Roles
obj.Role = "Space"
obj.setEditorMode("HorizontalArea",2)

View File

@@ -141,8 +141,7 @@ class _Stairs(ArchComponent.Component):
obj.setEditorMode("RiserHeight",1)
obj.setEditorMode("BlondelRatio",1)
self.Type = "Stairs"
self.Role = ["Stair","Stair Flight"]
self.Role = "Stair"
obj.Role = "Stair"
def execute(self,obj):

View File

@@ -53,9 +53,6 @@ __author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
# Possible roles for structural elements
Roles = ["Undefined","Beam","Column","Slab","Wall","Curtain Wall","Roof","Foundation","Pile","Tendon"]
#Reads preset profiles and categorizes them
Categories=[]
Presets=ArchProfile.readPresets()
@@ -463,7 +460,6 @@ class _Structure(ArchComponent.Component):
obj.addProperty("App::PropertyEnumeration","FaceMaker","Arch",QT_TRANSLATE_NOOP("App::Property","The facemaker type to use to build the profile of this object"))
self.Type = "Structure"
obj.FaceMaker = ["None","Simple","Cheese","Bullseye"]
obj.Role = Roles
obj.Role = "Beam"
def execute(self,obj):

View File

@@ -49,9 +49,6 @@ __title__="FreeCAD Wall"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
# Possible roles for walls
Roles = ['Undefined','Wall','Wall Layer','Beam','Column','Curtain Wall']
def makeWall(baseobj=None,length=None,width=None,height=None,align="Center",face=None,name="Wall"):
'''makeWall([obj],[length],[width],[height],[align],[face],[name]): creates a wall based on the
given object, which can be a sketch, a draft object, a face or a solid, or no object at
@@ -478,7 +475,6 @@ class _Wall(ArchComponent.Component):
obj.setEditorMode("CountBroken",1)
obj.Align = ['Left','Right','Center']
obj.Role = Roles
self.Type = "Wall"
obj.Role = "Wall"

View File

@@ -56,7 +56,6 @@ AllowedHosts = ["Wall","Structure","Roof"]
WindowPresets = ["Fixed", "Open 1-pane", "Open 2-pane", "Sash 2-pane",
"Sliding 2-pane", "Simple door", "Glass door", "Sliding 4-pane"]
WindowOpeningModes = ["None","Arc 90","Arc 90 inv","Arc 45","Arc 45 inv","Arc 180","Arc 180 inv","Triangle","Triangle inv","Sliding","Sliding inv"]
Roles = ["Undefined","Window","Door"]
def makeWindow(baseobj=None,width=None,height=None,parts=None,name="Window"):
@@ -804,7 +803,6 @@ class _Window(ArchComponent.Component):
obj.setEditorMode("HorizontalArea",2)
obj.setEditorMode("PerimeterLength",2)
self.Type = "Window"
obj.Role = Roles
obj.Role = "Window"
obj.Proxy = self
obj.MoveWithHost = True