Merge branch 'main' of https://gitaec.com/rvba/hackathon-zurich into main
This commit is contained in:
commit
6d66640905
3 changed files with 132 additions and 16 deletions
44
output/test.ifc
Normal file
44
output/test.ifc
Normal file
|
|
@ -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;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,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
|
||||||
|
|
@ -2,6 +2,7 @@ import sys
|
||||||
import os
|
import os
|
||||||
import datetime
|
import datetime
|
||||||
import random
|
import random
|
||||||
|
import csv
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
import ifcopenshell.util.selector
|
import ifcopenshell.util.selector
|
||||||
|
|
@ -19,12 +20,25 @@ def get_container(obj):
|
||||||
if container is not None:
|
if container is not None:
|
||||||
return container.Name
|
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):
|
def get_walls(model):
|
||||||
i=1
|
i=1
|
||||||
lst = []
|
lst = []
|
||||||
for wall in model.by_type("IfcWall"):
|
for wall in model.by_type("IfcWall"):
|
||||||
print(f"{i}:{wall.Name},container:{get_container(wall)}")
|
#print(f"{i}:{wall.Name},container:{get_container(wall)}")
|
||||||
lst.append(wall)
|
#d = f"{i},{wall.Name},{get_container(wall)}"
|
||||||
|
l = [i,get_container(wall),wall.Name]
|
||||||
|
lst.append(l)
|
||||||
i+=1
|
i+=1
|
||||||
return lst
|
return lst
|
||||||
|
|
||||||
|
|
@ -78,14 +92,16 @@ def create(name,objects):
|
||||||
print("writing " + name)
|
print("writing " + name)
|
||||||
model.write(name)
|
model.write(name)
|
||||||
|
|
||||||
def compute(p):
|
def compute_local(filename,p):
|
||||||
model = load_model(p)
|
model = load_model(p)
|
||||||
lst = get_walls(model)
|
lst = get_walls(model)
|
||||||
select(model,"IfcBuildingStorey")
|
select(model,"IfcBuildingStorey")
|
||||||
print("writing test.ifc")
|
print("writing test.ifc")
|
||||||
create("../output/test.ifc",lst)
|
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)
|
model = load_model(p)
|
||||||
lst = get_walls(model)
|
lst = get_walls(model)
|
||||||
select(model,"IfcBuildingStorey")
|
select(model,"IfcBuildingStorey")
|
||||||
|
|
@ -94,23 +110,22 @@ def compute_server(p):
|
||||||
now = str(datetime.datetime.now())
|
now = str(datetime.datetime.now())
|
||||||
p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/output/" + arg + "_" + now + ".ifc"
|
p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/output/" + arg + "_" + now + ".ifc"
|
||||||
create(p,lst)
|
create(p,lst)
|
||||||
|
localpath = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/output"
|
||||||
|
write_csv(localpath,filename,lst)
|
||||||
|
|
||||||
|
# Server
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
arg = "duplex"
|
filename = "duplex"
|
||||||
#p = "../ifc/" + arg + ".ifc"
|
p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/ifc/" + filename + ".ifc"
|
||||||
p = "/home/fordj/SOURCES/FORDJ/fordjx/hackathon-zurich/ifc/" + arg + ".ifc"
|
compute_server(filename,p)
|
||||||
compute_server(p)
|
# Local
|
||||||
elif len(sys.argv) > 1:
|
elif len(sys.argv) > 1:
|
||||||
arg = sys.argv[1]
|
filename = sys.argv[1]
|
||||||
print(f">> filename:{arg}")
|
print(f">> filename:{filename}")
|
||||||
if (arg == "list"):
|
p = "../ifc/" + filename + ".ifc"
|
||||||
print(os.listdir("../ifc"))
|
|
||||||
p = "../ifc/" + arg + ".ifc"
|
|
||||||
if os.path.exists(p):
|
if os.path.exists(p):
|
||||||
compute(p)
|
compute_local(filename,p)
|
||||||
else:
|
else:
|
||||||
print(os.listdir("../ifc"))
|
print(os.listdir("../ifc"))
|
||||||
else:
|
else:
|
||||||
print("extract [filepath]")
|
print("extract [filepath]")
|
||||||
|
|
||||||
# ...........
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue