I’m creating an export/import add-on (similar to STL import/export add-on) and I would like the suggested filename in the file browser to take the name of the currently selected object in the scene or a generic filename if multiple objects are selected. My add-on uses the bpy_extras.io_utils’s ExportHelper.
In the example below, for a new, unsaved blend file, the default filename is untitled.sur (sur is the extension the file exported by my addon). I would like this name to be “Icosphere.sur” since the object “Icosphere” is selected in the scene.