SketchUp 2017 + Wine + SketchUp STL: Empty dialog window on export

The SketchUp extension SketchUp STL allows you to export your model to an .stl file. But starting the export process only creates an empty/white dialog window.
The SketchUp STL dialog window pops up but it is all white. There are two options to fix this:
- Install IE8 in your prefix
- Change the extension code to not show the popup dialog
Install IE8 in your prefix
The dialog depends on IE8 to display its contents. You can install IE8 with e.g. winetricks. I noticed some program crashes, so I looked for another solution.
Change the extension code
In my case, I don't need to change the default settings shown in the dialog box, so I can skip it. The dialog window must therefore be completely bypassed in the code and the default settings used. This can be done by changing the file exporter.rb
file in the directory <path-to-prefix>/drive_c/users/<username>/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Plugins/sketchup-stl
.
To bypass the dialog, find method self.do_options
and replace it with the following code:
exporter.rb
def self.do_options
# Read last saved options or use defaults
['selection_only', 'stl_format', 'export_units'].each do |key|
OPTIONS[key] = read_setting(key, OPTIONS[key])
end
# Set default units and formats
units = ['Model Units', 'Meters', 'Centimeters', 'Millimeters', 'Inches', 'Feet']
formats = [STL_ASCII, STL_BINARY]
# No dialog window is needed, use the default options directly
export_entities = get_export_entities
if export_entities
path = select_export_file
begin
# Perform the export with the current settings
export(path, export_entities, OPTIONS) unless path.nil?
rescue => exception
msg = "SketchUp STL Exporter:\n"
msg << "An error occurred during export.\n\n"
msg << exception.message << "\n"
msg << exception.backtrace.join("\n")
UI.messagebox(msg, MB_MULTILINE)
end
end
end