mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Preliminary file existance check before attempting mapping
This commit is contained in:
@@ -1021,6 +1021,9 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type
|
||||
|
||||
%inline %{
|
||||
ifcopenshell::geometry::taxonomy::item::ptr map_shape(ifcopenshell::geometry::Settings& settings, IfcUtil::IfcBaseClass* instance) {
|
||||
if (instance->file_ == nullptr) {
|
||||
throw std::runtime_error("Unable to map instance without file");
|
||||
}
|
||||
std::unique_ptr<ifcopenshell::geometry::abstract_mapping> mapping(ifcopenshell::geometry::impl::mapping_implementations().construct(instance->file_, settings));
|
||||
return mapping->map(instance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user