From 6b5f0b48a8821185660bccfba9aa61c4d3312914 Mon Sep 17 00:00:00 2001 From: milovann Date: Sun, 4 Feb 2024 10:16:43 +0100 Subject: [PATCH] add csv output --- output/duplex.csv | 57 +++++++++++++++++++++++++++++++++++++++++++++++ output/test.ifc | 44 ++++++++++++++++++++++++++++++++++++ python/duplex | 57 +++++++++++++++++++++++++++++++++++++++++++++++ python/extract.py | 47 +++++++++++++++++++++++++------------- 4 files changed, 189 insertions(+), 16 deletions(-) create mode 100644 output/duplex.csv create mode 100644 output/test.ifc create mode 100644 python/duplex diff --git a/output/duplex.csv b/output/duplex.csv new file mode 100644 index 0000000..15403ed --- /dev/null +++ b/output/duplex.csv @@ -0,0 +1,57 @@ +1,Level 1,Basic Wall:Interior - Partition (92mm Stud):138584 +2,Level 1,Basic Wall:Party Wall - CMU Residential Unit Dimising Wall:139234 +3,Level 1,Basic Wall:Party Wall - CMU Residential Unit Dimising Wall:139347 +4,Level 1,Basic Wall:Party Wall - CMU Residential Unit Dimising Wall:139374 +5,Level 1,Basic Wall:Interior - Partition (92mm Stud):139783 +6,Level 1,Basic Wall:Interior - Partition (92mm Stud):139939 +7,T/FDN,Basic Wall:Foundation - Concrete (417mm):140479 +8,T/FDN,Basic Wall:Foundation - Concrete (417mm):140520 +9,T/FDN,Basic Wall:Foundation - Concrete (417mm):140554 +10,T/FDN,Basic Wall:Foundation - Concrete (417mm):140602 +11,T/FDN,Basic Wall:Foundation - Concrete (435mm):140913 +12,T/FDN,Basic Wall:Foundation - Concrete (435mm):140987 +13,T/FDN,Basic Wall:Foundation - Concrete (435mm):141018 +14,Level 2,Basic Wall:Party Wall - CMU Residential Unit Dimising Wall:143239 +15,Level 2,Basic Wall:Interior - Plumbing (152mm Stud):144138 +16,Level 2,Basic Wall:Interior - Partition (92mm Stud):144301 +17,Level 2,Basic Wall:Interior - Partition (92mm Stud):144684 +18,Level 2,Basic Wall:Interior - Plumbing (152mm Stud):144783 +19,Level 1,Basic Wall:Exterior - Brick on Block:138157 +20,Level 1,Basic Wall:Exterior - Brick on Block:138310 +21,Level 2,Basic Wall:Exterior - Brick on Block:143410 +22,Level 2,Basic Wall:Exterior - Brick on Block:143534 +23,Level 1,Basic Wall:Interior - Partition (92mm Stud):139682 +24,Level 1,Basic Wall:Interior - Partition (92mm Stud):139143 +25,Level 1,Basic Wall:Interior - Partition (92mm Stud):143856 +26,Level 1,Basic Wall:Interior - Partition (92mm Stud):144518 +27,Level 2,Basic Wall:Interior - Partition (92mm Stud):143960 +28,Level 2,Basic Wall:Interior - Partition (92mm Stud):144633 +29,Level 2,Basic Wall:Interior - Partition (92mm Stud):143921 +30,Level 2,Basic Wall:Interior - Partition (92mm Stud):144586 +31,Level 1,Basic Wall:Exterior - Brick on Block:138062 +32,Level 1,Basic Wall:Exterior - Brick on Block:138237 +33,Level 2,Basic Wall:Exterior - Brick on Block:143478 +34,Level 2,Basic Wall:Exterior - Brick on Block:143590 +35,Roof,Basic Wall:Exterior - Brick on Block:184944 +36,Roof,Basic Wall:Exterior - Brick on Block:185014 +37,Roof,Basic Wall:Exterior - Brick on Block:185064 +38,Roof,Basic Wall:Exterior - Brick on Block:185101 +39,Level 1,Basic Wall:Interior - Furring (152 mm Stud):189074 +40,Level 1,Basic Wall:Interior - Furring (152 mm Stud):189901 +41,Level 1,Basic Wall:Interior - Partition (92mm Stud):190140 +42,Level 1,Basic Wall:Interior - Furring (152 mm Stud):190774 +43,Level 1,Basic Wall:Interior - Furring (152 mm Stud):190933 +44,Level 2,Basic Wall:Interior - Furring (152 mm Stud):193247 +45,Level 2,Basic Wall:Interior - Furring (152 mm Stud):194166 +46,Level 2,Basic Wall:Interior - Partition (92mm Stud):203347 +47,Level 2,Basic Wall:Interior - Partition (92mm Stud):203998 +48,Level 1,Basic Wall:Interior - Partition (92mm Stud):204300 +49,Level 1,Basic Wall:Interior - Partition (92mm Stud):204493 +50,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217414 +51,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217415 +52,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217416 +53,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217417 +54,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217577 +55,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217578 +56,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217579 +57,Level 2,Basic Wall:Interior - Furring (38 mm Stud):217580 diff --git a/output/test.ifc b/output/test.ifc new file mode 100644 index 0000000..d5930af --- /dev/null +++ b/output/test.ifc @@ -0,0 +1,44 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2024-02-04T10:14:55',(),(),'IfcOpenShell v0.7.0-6c9e130ca','IfcOpenShell v0.7.0-6c9e130ca',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCPROJECT('1KFg9AVcf7ZA4pKYesd_7q',$,'My Project',$,$,$,$,(#10),#5); +#2=IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.); +#3=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.); +#4=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.); +#5=IFCUNITASSIGNMENT((#4,#2,#3)); +#6=IFCCARTESIANPOINT((0.,0.,0.)); +#7=IFCDIRECTION((0.,0.,1.)); +#8=IFCDIRECTION((1.,0.,0.)); +#9=IFCAXIS2PLACEMENT3D(#6,#7,#8); +#10=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,$); +#11=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#10,$,.MODEL_VIEW.,$); +#12=IFCSITE('1JlEpUBhDFjv646Y5GLdO7',$,'My Site',$,$,$,$,$,$,$,$,$,$,$); +#13=IFCBUILDING('2QsuZun2n2zh3_ydmx_pww',$,'Building A',$,$,$,$,$,$,$,$,$); +#14=IFCBUILDINGSTOREY('1DASFbLB9CG8k6pzCZX_ic',$,'Ground Floor',$,$,$,$,$,$,$); +#15=IFCRELAGGREGATES('0NKorMQVPAy9gQEiztO2Dm',$,$,$,#1,(#12)); +#16=IFCRELAGGREGATES('29dNMUBgnBKxrhsH2OmJ9o',$,$,$,#12,(#13)); +#17=IFCRELAGGREGATES('2HxScpoc98ku076i_YKL9j',$,$,$,#13,(#14)); +#18=IFCWALL('3XT2fcxArED8hhnJ$4IYkD',$,$,$,$,#40,#34,$,$); +#24=IFCCARTESIANPOINTLIST2D(((0.,0.),(0.,82.2207884473077),(12517.2093579473,82.2207884473077),(12517.2093579473,0.),(0.,0.))); +#25=IFCINDEXEDPOLYCURVE(#24,$,.F.); +#26=IFCDIRECTION((0.,0.,1.)); +#27=IFCARBITRARYCLOSEDPROFILEDEF(.AREA.,$,#25); +#28=IFCCARTESIANPOINT((0.,0.,0.)); +#29=IFCDIRECTION((0.,0.,1.)); +#30=IFCDIRECTION((1.,0.,0.)); +#31=IFCAXIS2PLACEMENT3D(#28,#29,#30); +#32=IFCEXTRUDEDAREASOLID(#27,#31,#26,4402.92423431747); +#33=IFCSHAPEREPRESENTATION(#11,'Body','SweptSolid',(#32)); +#34=IFCPRODUCTDEFINITIONSHAPE($,$,(#33)); +#35=IFCRELCONTAINEDINSPATIALSTRUCTURE('1WBz24QBf0pQG9cunlitZn',$,$,$,(#18),#14); +#36=IFCCARTESIANPOINT((0.,0.,0.)); +#37=IFCDIRECTION((0.,0.,1.)); +#38=IFCDIRECTION((1.,0.,0.)); +#39=IFCAXIS2PLACEMENT3D(#36,#37,#38); +#40=IFCLOCALPLACEMENT($,#39); +ENDSEC; +END-ISO-10303-21; diff --git a/python/duplex b/python/duplex new file mode 100644 index 0000000..d705736 --- /dev/null +++ b/python/duplex @@ -0,0 +1,57 @@ +1,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,P,a,r,t,i,t,i,o,n, ,(,9,2,m,m, ,S,t,u,d,),:,1,3,8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4,1,5,|,|,L,e,v,e,l, ,2 +5,2,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,F,u,r,r,i,n,g, ,(,3,8, ,m,m, ,S,t,u,d,),:,2,1,7,4,1,6,|,|,L,e,v,e,l, ,2 +5,3,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,F,u,r,r,i,n,g, ,(,3,8, ,m,m, ,S,t,u,d,),:,2,1,7,4,1,7,|,|,L,e,v,e,l, ,2 +5,4,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,F,u,r,r,i,n,g, ,(,3,8, ,m,m, ,S,t,u,d,),:,2,1,7,5,7,7,|,|,L,e,v,e,l, ,2 +5,5,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,F,u,r,r,i,n,g, ,(,3,8, ,m,m, ,S,t,u,d,),:,2,1,7,5,7,8,|,|,L,e,v,e,l, ,2 +5,6,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,F,u,r,r,i,n,g, ,(,3,8, ,m,m, ,S,t,u,d,),:,2,1,7,5,7,9,|,|,L,e,v,e,l, ,2 +5,7,|,|,B,a,s,i,c, ,W,a,l,l,:,I,n,t,e,r,i,o,r, ,-, ,F,u,r,r,i,n,g, ,(,3,8, ,m,m, ,S,t,u,d,),:,2,1,7,5,8,0,|,|,L,e,v,e,l, ,2 diff --git a/python/extract.py b/python/extract.py index cf987f8..bb91c95 100644 --- a/python/extract.py +++ b/python/extract.py @@ -2,6 +2,7 @@ import sys import os import datetime import random +import csv import ifcopenshell import ifcopenshell.util.element import ifcopenshell.util.selector @@ -19,12 +20,25 @@ def get_container(obj): if container is not None: return container.Name +def write_csv(path,filename,datalist): + print(f"?{filename}") + f = path + "/" + filename + ".csv" + print(f"writing {f}") + with open(f,'w',newline='') as csvfile: + #writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL) + writer = csv.writer(csvfile, delimiter=',') + for item in datalist: + #print("writing",item) + writer.writerow(item) + def get_walls(model): i=1 lst = [] for wall in model.by_type("IfcWall"): - print(f"{i}:{wall.Name},container:{get_container(wall)}") - lst.append(wall) + #print(f"{i}:{wall.Name},container:{get_container(wall)}") + #d = f"{i},{wall.Name},{get_container(wall)}" + l = [i,get_container(wall),wall.Name] + lst.append(l) i+=1 return lst @@ -78,14 +92,16 @@ def create(name,objects): print("writing " + name) model.write(name) -def compute(p): +def compute_local(filename,p): model = load_model(p) lst = get_walls(model) select(model,"IfcBuildingStorey") print("writing test.ifc") create("../output/test.ifc",lst) + localpath = "../output" + write_csv(localpath,filename,lst) -def compute_server(p): +def compute_server(filename,p): model = load_model(p) lst = get_walls(model) select(model,"IfcBuildingStorey") @@ -94,23 +110,22 @@ def compute_server(p): now = str(datetime.datetime.now()) p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/output/" + arg + "_" + now + ".ifc" create(p,lst) + localpath = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/output" + write_csv(localpath,filename,lst) +# Server if len(sys.argv) == 1: - arg = "duplex" - #p = "../ifc/" + arg + ".ifc" - p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/ifc/" + arg + ".ifc" - compute_server(p) + filename = "duplex" + p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/ifc/" + filename + ".ifc" + compute_server(filename,p) +# Local elif len(sys.argv) > 1: - arg = sys.argv[1] - print(f">> filename:{arg}") - if (arg == "list"): - print(os.listdir("../ifc")) - p = "../ifc/" + arg + ".ifc" + filename = sys.argv[1] + print(f">> filename:{filename}") + p = "../ifc/" + filename + ".ifc" if os.path.exists(p): - compute(p) + compute_local(filename,p) else: print(os.listdir("../ifc")) else: print("extract [filepath]") - -# ...........