diff --git a/src/Mod/Arch/ArchBuilding.py b/src/Mod/Arch/ArchBuilding.py index 246d96f70..811b6d865 100644 --- a/src/Mod/Arch/ArchBuilding.py +++ b/src/Mod/Arch/ArchBuilding.py @@ -34,6 +34,148 @@ __title__="FreeCAD Building" __author__ = "Yorik van Havre" __url__ = "http://www.freecadweb.org" +BuildingTypes = ['Undefined', +'Agricultural - Barn', +'Agricultural - Chicken coop or chickenhouse', +'Agricultural - Cow-shed', +'Agricultural - Farmhouse', +'Agricultural - Granary', +'Agricultural - Greenhouse', +'Agricultural - Hayloft', +'Agricultural - Pigpen or sty', +'Agricultural - Root cellar', +'Agricultural - Shed', +'Agricultural - Silo', +'Agricultural - Stable', +'Agricultural - Storm cellar', +'Agricultural - Well house', +'Agricultural - Underground pit', + +'Commercial - Automobile repair shop', +'Commercial - Bank', +'Commercial - Car wash', +'Commercial - Convention center', +'Commercial - Forum', +'Commercial - Gas station', +'Commercial - Hotel', +'Commercial - Market', +'Commercial - Market house', +'Commercial - Skyscraper', +'Commercial - Shop', +'Commercial - Shopping mall', +'Commercial - Supermarket', +'Commercial - Warehouse', +'Commercial - Restaurant', + +'Residential - Apartment block', +'Residential - Asylum', +'Residential - Condominium', +'Residential - Dormitory', +'Residential - Duplex', +'Residential - House', +'Residential - Nursing home', +'Residential - Townhouse', +'Residential - Villa', +'Residential - Bungalow', + +'Educational - Archive', +'Educational - College classroom building', +'Educational - College gymnasium', +'Educational - College students union', +'Educational - School', +'Educational - Library', +'Educational - Museum', +'Educational - Art gallery', +'Educational - Theater', +'Educational - Amphitheater', +'Educational - Concert hall', +'Educational - Cinema', +'Educational - Opera house', +'Educational - Boarding school', + +'Government - Capitol', +'Government - City hall', +'Government - Consulate', +'Government - Courthouse', +'Government - Embassy', +'Government - Fire station', +'Government - Meeting house', +'Government - Moot hall', +'Government - Palace', +'Government - Parliament', +'Government - Police station', +'Government - Post office', +'Government - Prison', + +'Industrial - Brewery', +'Industrial - Factory', +'Industrial - Foundry', +'Industrial - Power plant', +'Industrial - Mill', + +'Military - Arsenal', +'Military -Barracks', + +'Parking - Boathouse', +'Parking - Garage', +'Parking - Hangar', + +'Storage - Silo', +'Storage - Hangar', + +'Religious - Church', +'Religious - Basilica', +'Religious - Cathedral', +'Religious - Chapel', +'Religious - Oratory', +'Religious - Martyrium', +'Religious - Mosque', +'Religious - Mihrab', +'Religious - Surau', +'Religious - Imambargah', +'Religious - Monastery', +'Religious - Mithraeum', +'Religious - Fire temple', +'Religious - Shrine', +'Religious - Synagogue', +'Religious - Temple', +'Religious - Pagoda', +'Religious - Gurdwara', +'Religious - Hindu temple', + +'Transport - Airport terminal', +'Transport - Bus station', +'Transport - Metro station', +'Transport - Taxi station', +'Transport - Railway station', +'Transport - Signal box', +'Transport - Lighthouse', + +'Infrastructure - Data centre', + +'Power station - Fossil-fuel power station', +'Power station - Nuclear power plant', +'Power station - Geothermal power', +'Power station - Biomass-fuelled power plant', +'Power station - Waste heat power plant', +'Power station - Renewable energy power station', +'Power station - Atomic energy plant', + +'Other - Apartment', +'Other - Clinic', +'Other - Community hall', +'Other - Eatery', +'Other - Folly', +'Other - Food court', +'Other - Hospice', +'Other - Hospital', +'Other - Hut', +'Other - Bathhouse', +'Other - Workshop', +'Other - World trade centre' +] + + def makeBuilding(objectslist=None,baseobj=None,name="Building"): '''makeBuilding(objectslist): creates a building including the objects from the given list.''' @@ -87,8 +229,10 @@ class _Building(ArchFloor._Floor): "The Building object" def __init__(self,obj): ArchFloor._Floor.__init__(self,obj) + obj.addProperty("App::PropertyEnumeration","BuildingType","Arch",translate("Arch","The type of this building")) self.Type = "Building" obj.setEditorMode('Height',2) + obj.BuildingType = BuildingTypes class _ViewProviderBuilding(ArchFloor._ViewProviderFloor): "A View Provider for the Building object" diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index e8cadf330..73bf2f778 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -93,7 +93,10 @@ class _Site(ArchFloor._Floor): def __init__(self,obj): ArchFloor._Floor.__init__(self,obj) obj.addProperty("App::PropertyLink","Terrain","Arch",translate("Arch","The terrain of this site")) - obj.addProperty("App::PropertyString","Address","Arch",translate("Arch","The address of this site")) + obj.addProperty("App::PropertyString","Address","Arch",translate("Arch","The street and housenumber of this site")) + obj.addProperty("App::PropertyString","PostalCode","Arch",translate("Arch","The postal or zip code of this site")) + obj.addProperty("App::PropertyString","City","Arch",translate("Arch","The city of this site")) + obj.addProperty("App::PropertyString","Country","Arch",translate("Arch","The country of this site")) obj.addProperty("App::PropertyString","Coordinates","Arch",translate("Arch","The geographic coordinates of this site")) obj.addProperty("App::PropertyString","Url","Arch",translate("Arch","An url that shows this site in a mapping website")) self.Type = "Site" diff --git a/src/Mod/Arch/ArchSpace.py b/src/Mod/Arch/ArchSpace.py index 2f8e7eb43..2f2837a4e 100644 --- a/src/Mod/Arch/ArchSpace.py +++ b/src/Mod/Arch/ArchSpace.py @@ -223,13 +223,14 @@ class _Space(ArchComponent.Component): "A space object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLinkSubList","Boundaries", "Arch",translate("Arch","The objects that make the boundaries of this space object")) - obj.addProperty("App::PropertyFloat", "Area", "Arch",translate("Arch","The computed floor area of this space")) - obj.addProperty("App::PropertyString", "FinishFloor", "Arch",translate("Arch","The finishing of the floor of this space")) - obj.addProperty("App::PropertyString", "FinishWalls", "Arch",translate("Arch","The finishing of the walls of this space")) - 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")) - obj.addProperty("App::PropertyEnumeration","SpaceType", "Arch",translate("Arch","The type of this space")) + obj.addProperty("App::PropertyLinkSubList","Boundaries", "Arch",translate("Arch","The objects that make the boundaries of this space object")) + obj.addProperty("App::PropertyFloat", "Area", "Arch",translate("Arch","The computed floor area of this space")) + obj.addProperty("App::PropertyString", "FinishFloor", "Arch",translate("Arch","The finishing of the floor of this space")) + obj.addProperty("App::PropertyString", "FinishWalls", "Arch",translate("Arch","The finishing of the walls of this space")) + 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")) + obj.addProperty("App::PropertyEnumeration","SpaceType", "Arch",translate("Arch","The type of this space")) + obj.addProperty("App::PropertyLength", "FloorThickness","Arch",translate("Arch","The thickness of the floor finish")) self.Type = "Space" self.SpaceType = "Undefined" obj.Role = Roles diff --git a/src/Mod/Arch/importGBXML.py b/src/Mod/Arch/importGBXML.py new file mode 100644 index 000000000..ab03066db --- /dev/null +++ b/src/Mod/Arch/importGBXML.py @@ -0,0 +1,410 @@ +#*************************************************************************** +#* * +#* Copyright (c) 2015 * +#* Yorik van Havre * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU Lesser General Public License (LGPL) * +#* as published by the Free Software Foundation; either version 2 of * +#* the License, or (at your option) any later version. * +#* for detail see the LICENCE text file. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU Library General Public License for more details. * +#* * +#* You should have received a copy of the GNU Library General Public * +#* License along with this program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +#* USA * +#* * +#*************************************************************************** + +__title__= "FreeCAD GbXml exporter" +__author__ = "Yorik van Havre" +__url__ = "http://www.freecadweb.org" + +import os,FreeCAD,Draft + +if FreeCAD.GuiUp: + from DraftTools import translate +else: + def translate(ctx,txt): + return txt + +if open.__module__ == '__builtin__': + pyopen = open # because we'll redefine open below + + +def export(objectslist,filename): + + if len(objectslist) != 1: + FreeCAD.Console.PrintError(translate("Arch","This exporter can currently only export one site object")) + return + site = objectslist[0] + if Draft.getType(site) != "Site": + FreeCAD.Console.PrintError(translate("Arch","This exporter can currently only export one site object")) + return + + filestream = pyopen(filename,"wb") + + # header + filestream.write( '\n' ) + filestream.write( '\n' % FreeCAD.Version()[0]+FreeCAD.Version()[1]+FreeCAD.Version()[2] ) + filestream.write( '\n' ) + filestream.write( '\n' ) + + # campus + filestream.write( '\n' % site.Name ) + filestream.write( '\n' ) + filestream.write( ' %s\n' % site.PostalCode ) + filestream.write( '\n' ) + + # building + for building in site.Group: + if Draft.getType(building) == "Building": + area = 10000.0 # TODO calculate + filestream.write( ' \n' % (building.Name,building.BuildingType) ) + filestream.write( ' $f\n' % area ) + + # space + for space in Draft.getGroupContents(building): + if Draft.getType(space) == "Space": + zone = "BLABLA" # TODO build values + filestream.write( ' \n' % (space.Name, space.SpaceType, zone) ) + filestream.write( ' %s\n' % space.Label ) + filestream.write( ' %s\n' % space.Description ) + filestream.write( ' %s\n' % space.Label ) + #filestream.write( ' 1.00000\n' ) + #filestream.write( ' 1.50000\n' ) + #filestream.write( ' 0.00000\n' ) + filestream.write( ' $f\n' % space.Area + + + filestream.write( ' \n' ) + + filestream.write( '\n' ) + + filestream.write( '' ) + +''' + 18000.00000 + + Lab corridor + + 1.00000 + 1.50000 + 0.00000 + 800.00000 + 6400.00000 + + + + + 0.00000 + 1200.00000 + 0.00000 + + + 0.00000 + 1200.00000 + 96.00000 + + + 480.00000 + 1200.00000 + 96.00000 + + + 480.00000 + 1200.00000 + 0.00000 + + + + ... repeat + + + + 21E2 + + + ... repeat + + + + + + + Floor + + + 90.00 + + 0.00000 + 1320.00000 + 0.00000 + + 180.00 + 480.00000 + 240.00000 + + + + + 0.00000 + 1320.00000 + 0.00000 + + + 480.00000 + 1320.00000 + 0.00000 + + + 960.00000 + 1320.00000 + 0.00000 + + + 960.00000 + 1200.00000 + 0.00000 + + + 480.00000 + 1200.00000 + 0.00000 + + + 0.00000 + 1200.00000 + 0.00000 + + + + + + + + + Surface 4 + + + 180.00 + + 960.00000 + 0.00000 + 0.00000 + + 90.00 + 114.00000 + 480.00000 + + + + + 960.00000 + 0.00000 + 0.00000 + + + 1440.00000 + 0.00000 + 0.00000 + + + 1440.00000 + 0.00000 + 114.00000 + + + 960.00000 + 0.00000 + 114.00000 + + + + + Opening1 + + + 96.00000 + 24.00000 + + 72.00000 + 48.00000 + + + + + 1056.00000 + 0.00000 + 24.00000 + + + 1104.00000 + 0.00000 + 24.00000 + + + 1104.00000 + 0.00000 + 96.00000 + + + 1056.00000 + 0.00000 + 96.00000 + + + + + + Opening2 + + + 216.00000 + 24.00000 + + 72.00000 + 48.00000 + + + + + 1176.00000 + 0.00000 + 24.00000 + + + 1224.00000 + 0.00000 + 24.00000 + + + 1224.00000 + 0.00000 + 96.00000 + + + 1176.00000 + 0.00000 + 96.00000 + + + + + + Opening3 + + + 336.00000 + 24.00000 + + 72.00000 + 48.00000 + + + + + 1296.00000 + 0.00000 + 24.00000 + + + 1344.00000 + 0.00000 + 24.00000 + + + 1344.00000 + 0.00000 + 96.00000 + + + 1296.00000 + 0.00000 + 96.00000 + + + + + + + + ... repeat + + + + + + + Standard + + + + Standard + + + + Standard + + + + Standard + + + + + + + Lab and Corridor + + 0" + 0.00000 + 0.00000 + 2.37037 + 812.69841 + 72.00000 + 75.00000 + + + Office + + 1" + 0.13333 + 20.00000 + 0.05333 + 8.00000 + 72.00000 + 75.00000 + + + Warehouse + + 5/32" + 0.05000 + 25.71429 + 0.00000 + 0.00000 + 60.00000 + 80.00000 + + + + + sp3_LabandCorridor_Lab1 + 5534.837890625 + Space Cooling Roof Cond + 21E3 + + +... repeat + +''' + + + +