From c91d6d54bcd128ff62e426be01e75fc32839fda0 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 24 Jul 2026 16:56:49 +0500 Subject: [PATCH] new_IfcBaseClass: use ref for safety --- src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi | 2 +- src/ifcwrap/IfcParseWrapper.i | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi b/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi index f3a045dbbe..ea66356ea8 100644 --- a/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi +++ b/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi @@ -1640,7 +1640,7 @@ def less(arg1, arg2): ... def line_segments_to_polygons(s, eps, segments): ... def map_shape(settings, instance): ... def nary_union(sequence): ... -def new_IfcBaseClass(schema_identifier: str, name: str) -> entity_instance: ... +def new_IfcBaseClass(file: file, name: str) -> entity_instance: ... def open(fn: str, readonly: bool = False, logger=None) -> file: ... def polygons_to_svg(*args): ... def read(data): ... diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index ec76973e4d..003a839b94 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -1045,8 +1045,8 @@ from .entity_instance import entity_instance_mixin as _entity_instance_mixin_bas return IFCOPENSHELL_VERSION; } - express::Base new_IfcBaseClass(ifcopenshell::file* file, const std::string& name) { - return file->create(file->schema()->declaration_by_name(name)); + express::Base new_IfcBaseClass(ifcopenshell::file& file, const std::string& name) { + return file.create(file.schema()->declaration_by_name(name)); } %}