MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / cmd_quantify

Function cmd_quantify

src/ifcedit/ifcedit/__main__.py:178–198  ·  view source on GitHub ↗
(args, extra_args)

Source from the content-addressed store, hash-verified

176
177
178def cmd_quantify(args, extra_args):
179 if args.quantify_command == "list":
180 result = list_rules()
181 print(format_output(result, args.output_format))
182 elif args.quantify_command == "run":
183 try:
184 model = ifcopenshell.open(args.ifc_file)
185 except Exception as e:
186 print(f"Error: Could not open IFC file: {e}", file=sys.stderr)
187 sys.exit(1)
188 selector = args.selector or None
189 result = run_quantify(model, args.rule_name, selector=selector)
190 if result["ok"]:
191 output_path = args.output or args.ifc_file
192 model.write(output_path)
193 print(format_output(result, args.output_format))
194 if not result["ok"]:
195 sys.exit(1)
196 else:
197 print("Error: quantify requires a subcommand: list or run", file=sys.stderr)
198 sys.exit(1)
199
200
201def main():

Callers 1

mainFunction · 0.85

Calls 7

list_rulesFunction · 0.90
run_quantifyFunction · 0.90
printFunction · 0.85
openMethod · 0.80
format_outputFunction · 0.70
exitMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected