Arch: Extended role property to all Arch objects - fixes #1577

This commit is contained in:
Yorik van Havre 2014-09-21 15:12:06 -03:00
parent 4f5f9be38c
commit e08788eca9
7 changed files with 9 additions and 9 deletions

View File

@ -26,9 +26,10 @@ __author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
# Possible roles for IFC objects
Roles = ['Undefined','Beam','Chimney','Column','Covering','Curtain Wall','Door','Foundation',
'Member','Plate','Railing','Ramp','Ramp Flight','Rebar','Pile','Roof','Shading Device','Slab',
'Stair','Stair Flight','Tendon','Wall','Wall Layer','Window']
Roles = ['Undefined','Beam','Beam Standard Case','Chimney','Column','Column Standard Case','Covering','Curtain Wall',
'Door','Door Standard Case','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 Standard Case','Wall Layer','Window','Window Standard Case']
import FreeCAD,Draft
from FreeCAD import Vector
@ -294,6 +295,7 @@ class Component:
obj.addProperty("App::PropertyString","Tag","Arch","An optional tag for this component")
obj.addProperty("App::PropertyMap","IfcAttributes","Arch","Custom IFC properties and attributes")
obj.addProperty("App::PropertyMap","Material","Arch","A material for this object")
obj.addProperty("App::PropertyEnumeration","Role","Arch",translate("Arch","The role of this object"))
obj.Proxy = self
self.Type = "Component"
self.Subvolume = None

View File

@ -237,7 +237,6 @@ class _Equipment(ArchComponent.Component):
obj.addProperty("Part::PropertyPartShape","SideView","Arch",translate("Arch","an optional 2D shape representing a side view of this equipment"))
obj.addProperty("App::PropertyString","Model","Arch",translate("Arch","The model description of this equipment"))
obj.addProperty("App::PropertyString","Url","Arch",translate("Arch","The url of the product page of this equipment"))
obj.addProperty("App::PropertyEnumeration","Role","Arch",translate("Arch","The role of this equipment"))
self.Type = "Equipment"
obj.Role = Roles
obj.Proxy = self

View File

@ -84,7 +84,6 @@ class _Frame(ArchComponent.Component):
obj.addProperty("App::PropertyBool","Align","Arch","Specifies if the profile must be aligned with the extrusion wires")
obj.addProperty("App::PropertyVector","Offset","Arch","An offset vector between the base sketch and the frame")
obj.addProperty("App::PropertyAngle","Rotation","Arch","The rotation of the profile around its extrusion axis")
obj.addProperty("App::PropertyEnumeration","Role","Arch","The role of this wall")
self.Type = "Frame"
obj.Role = Roles

View File

@ -27,6 +27,8 @@ __title__="FreeCAD Arch Space"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
Roles = ["Space"]
import FreeCAD,ArchComponent,ArchCommands,math,Draft
if FreeCAD.GuiUp:
import FreeCADGui
@ -115,6 +117,7 @@ class _Space(ArchComponent.Component):
obj.addProperty("App::PropertyString", "FinishCeiling","Arch",translate("Arch","The finishing of the ceiling of this space"))
obj.addProperty("App::PropertyLinkList", "Group", "Arch",translate("Arch","Objects that are included inside this space, such as furniture"))
self.Type = "Space"
obj.Role = Roles
def execute(self,obj):
self.getShape(obj)

View File

@ -556,9 +556,8 @@ class _Structure(ArchComponent.Component):
obj.addProperty("App::PropertyLength","Height","Arch",translate("Arch","The height or extrusion depth of this element. Keep 0 for automatic"))
obj.addProperty("App::PropertyLinkList","Armatures","Arch",translate("Arch","Armatures contained in this element"))
obj.addProperty("App::PropertyVector","Normal","Arch",translate("Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)"))
obj.addProperty("App::PropertyEnumeration","Role","Arch",translate("Arch","The role of this structural element"))
obj.addProperty("App::PropertyVectorList","Nodes","Arch",translate("Arch","The structural nodes of this element"))
obj.addProperty("App::PropertyString","Profile","Arch","A description of the standard profile this element is based upon")
obj.addProperty("App::PropertyString","Profile","Arch",translate("Arch","A description of the standard profile this element is based upon"))
self.Type = "Structure"
obj.Role = Roles

View File

@ -395,7 +395,6 @@ class _Wall(ArchComponent.Component):
obj.addProperty("App::PropertyVector","Normal","Arch",translate("Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)"))
obj.addProperty("App::PropertyInteger","Face","Arch",translate("Arch","The face number of the base object used to build this wall"))
obj.addProperty("App::PropertyLength","Offset","Arch",translate("Arch","The offset between this wall and its baseline (only for left and right alignments)"))
obj.addProperty("App::PropertyEnumeration","Role","Arch",translate("Arch","The role of this wall"))
obj.Align = ['Left','Right','Center']
obj.Role = Roles
self.Type = "Wall"

View File

@ -608,7 +608,6 @@ class _Window(ArchComponent.Component):
obj.addProperty("App::PropertyLength","Height","Arch",translate("Arch","The height of this window (for preset windows only)"))
obj.addProperty("App::PropertyVector","Normal","Arch",translate("Arch","The normal direction of this window"))
obj.addProperty("App::PropertyInteger","Preset","Arch","")
obj.addProperty("App::PropertyEnumeration","Role","Arch",translate("Arch","The role of this window"))
obj.setEditorMode("Preset",2)
self.Type = "Window"