mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 10:34:31 +00:00
You can now switch contexts of of objects in bulk
This commit is contained in:
@@ -39,7 +39,19 @@ def execute(args):
|
||||
else:
|
||||
patcher = recipe.Patcher(args["input"], ifc_file, logger, args["arguments"])
|
||||
patcher.patch()
|
||||
return getattr(patcher, "file_patched", patcher.file)
|
||||
output = getattr(patcher, "file_patched", patcher.file)
|
||||
if isinstance(output, str):
|
||||
with open(args["output"], "w") as text_file:
|
||||
text_file.write(output)
|
||||
return output
|
||||
|
||||
|
||||
def write(output, filepath):
|
||||
if isinstance(output, str):
|
||||
with open(filepath, "w") as text_file:
|
||||
text_file.write(output)
|
||||
else:
|
||||
output.write(filepath)
|
||||
|
||||
|
||||
def extract_docs(
|
||||
|
||||
@@ -34,15 +34,11 @@ print("# Loading IFC file ...")
|
||||
args["input"] = ifcopenshell.open(args["input"])
|
||||
|
||||
print("# Patching ...")
|
||||
ifc_file = ifcpatch.execute(args)
|
||||
output = ifcpatch.execute(args)
|
||||
|
||||
print("# Writing patched file ...")
|
||||
if not args["output"]:
|
||||
args["output"] = args["input"]
|
||||
if isinstance(ifc_file, str):
|
||||
with open(args["output"], "w") as text_file:
|
||||
text_file.write(ifc_file)
|
||||
else:
|
||||
ifc_file.write(args["output"])
|
||||
ifcpatch.write(output, args["output"])
|
||||
|
||||
print("# All tasks are complete :-)")
|
||||
|
||||
Reference in New Issue
Block a user