python
This commit is contained in:
parent
104c4b2677
commit
35787b3845
1 changed files with 14 additions and 7 deletions
|
|
@ -63,26 +63,33 @@ def create(name,objects):
|
|||
run("geometry.assign_representation", model, product=wall, representation=representation)
|
||||
run("spatial.assign_container", model, relating_structure=storey, product=wall)
|
||||
|
||||
for item in lst:
|
||||
for item in objects:
|
||||
print("adding",item)
|
||||
run("spatial.assign_container", model, relating_structure=storey, product=item)
|
||||
|
||||
model.write(name)
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
def compute(p):
|
||||
model = load_model(p)
|
||||
lst = get_walls(model)
|
||||
select(model,"IfcBuildingStorey")
|
||||
print("writing test.ifc")
|
||||
create("../output/test.ifc",lst)
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
arg = "duplex"
|
||||
p = "../ifc/" + arg + ".ifc"
|
||||
compute(p)
|
||||
elif len(sys.argv) > 1:
|
||||
arg = sys.argv[1]
|
||||
print(f">> filename:{arg}")
|
||||
if (arg == "list"):
|
||||
print(os.listdir("../ifc"))
|
||||
p = "../ifc/" + arg + ".ifc"
|
||||
if os.path.exists(p):
|
||||
model = load_model(p)
|
||||
lst = get_walls(model)
|
||||
select(model,"IfcBuildingStorey")
|
||||
create("../output/test.ifc",lst)
|
||||
compute(p)
|
||||
else:
|
||||
print(os.listdir("../ifc"))
|
||||
|
||||
else:
|
||||
print("extract [filepath]")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue