Fix Wrong number or type of arguments for overloaded function 'new_file

I got this error, so I used the same pattern I saw in the generated wrapper py:

                            |   File "/home/dion/.config/blender/5.2/extensions/.local/lib/python3.13/site-packages/ifcopenshell/api/project/create_file.py", line 54, in create_file
                            |     file = ifcopenshell.file(schema=version)
                            |   File "/home/dion/.config/blender/5.2/extensions/.local/lib/python3.13/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 5242, in __init__
                            |     _ifcopenshell_wrapper.new_file(self, identifier)
                            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                            | TypeError: Wrong number or type of arguments for overloaded function 'new_file'.
                            |   Possible C/C++ prototypes are:
                            |     ifcopenshell::file::file(std::string const &,ifcopenshell::filetype,bool,::logger &)
                            |     ifcopenshell::file::file(std::string const &,ifcopenshell::filetype,bool)
                            |     ifcopenshell::file::file(std::string const &,ifcopenshell::filetype)
                            |     ifcopenshell::file::file(std::istream &,int,::logger &)
                            |     ifcopenshell::file::file(std::istream &,int)
                            |     ifcopenshell::file::file(void *,int,::logger &)
                            |     ifcopenshell::file::file(void *,int)
                            |     ifcopenshell::file::file(ifcopenshell::schema_definition const *,ifcopenshell::filetype,std::string const &,::logger &)
                            |     ifcopenshell::file::file(ifcopenshell::schema_definition const *,ifcopenshell::filetype,std::string const &)
                            |     ifcopenshell::file::file(ifcopenshell::schema_definition const *,ifcopenshell::filetype)
                            |     ifcopenshell::file::file(ifcopenshell::schema_definition const *)
                            |     ifcopenshell::file::file()
                            |     ifcopenshell::file::file(ifcopenshell::uninitialized_tag const &,::logger &)
                            |     ifcopenshell::file::file(ifcopenshell::uninitialized_tag const &)
                            |     ifcopenshell::file::file(std::string const &)
This commit is contained in:
Dion Moult
2026-07-27 19:22:15 +10:00
parent 19a1d88970
commit a84957fd45
+1 -1
View File
@@ -45,7 +45,7 @@
identifier = schema_identifier
else:
identifier = self._determine_schema_identifier(schema=schema, schema_version=schema_version)
$action(self, identifier)
_ifcopenshell_wrapper.file_swiginit(self, $action(identifier))
%}
%ignore ifcopenshell::instance_streamer<ifcopenshell::file_reader<ifcopenshell::full_buffer_impl>>::read_instance;