Execute an ifcopenshell.api mutation. params may be: - JSON string - dict (from tool calling / JS) - JsProxy (handled upstream in embedded.py)
(self, function_path: str, params: Any = "{}")
| 335 | return function_docs(module, function) |
| 336 | |
| 337 | def ifc_edit(self, function_path: str, params: Any = "{}") -> dict: |
| 338 | """Execute an ifcopenshell.api mutation. |
| 339 | |
| 340 | params may be: |
| 341 | - JSON string |
| 342 | - dict (from tool calling / JS) |
| 343 | - JsProxy (handled upstream in embedded.py) |
| 344 | """ |
| 345 | model = self._require_model() |
| 346 | module, function = function_path.split(".", 1) |
| 347 | |
| 348 | if isinstance(params, str): |
| 349 | raw_kwargs = json.loads(params) if params.strip() else {} |
| 350 | elif isinstance(params, dict): |
| 351 | raw_kwargs = params |
| 352 | else: |
| 353 | # e.g. list/None/etc |
| 354 | raw_kwargs = dict(params) if params is not None else {} |
| 355 | |
| 356 | res = run_api(model, module, function, raw_kwargs) |
| 357 | return _jsonify(res) |
| 358 | |
| 359 | # ------------------------ |
| 360 | # Extended query + edit tools |