SketchUp / sketchup-stl

A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
http://extensions.sketchup.com/content/sketchup-stl
MIT License
248 stars 68 forks source link

Sketchup 2017 under wine - Blank export settings #171

Closed Witko closed 7 years ago

Witko commented 7 years ago

Currently, after clicking export to stl a window is shown, but its blank. This prevents the usage of export completely.

Aerilius commented 7 years ago

Sketchup-stl uses SKUI for its user interface. SKUI works only in WebDialogs and uses some Windows-libraries outside of the official SketchUp Ruby API. I see two possible causes of the problem:

Keep in mind SketchUp does not officially support Wine, which is odd, considering Wine is the only way to access SketchUp on one of the most important maker platforms.

Porting SKUI to HtmlDialog would circumvent the problem. Making a plain-old simple webdialog version of the UI would also help. As a work-around you can use the command line interface on the Ruby console:

CommunityExtensions::STL::Exporter.export("Z:/home/Witko/model.stl", Sketchup.active_model.active_entities, {'selection_only' => false, 'export_units' => 'Model Units', 'stl_format' => 'ASCII'})
Witko commented 7 years ago

Hi, thanks for response - it does work. Im trying to implement my own extension which would call this - is it possible? Im a bit stuck at the actual call - i cant see the error that happens. This is the code i have so far:

require 'sketchup'
require 'extensions'
require 'sketchup-stl'

module Examples
  module StlExport

def self.export_stl
  CommunityExtensions::STL::Exporter.export("Z:/tmp/model.stl", Sketchup.active_model.active_entities, {'selection_only' => false, 'export_units' => 'Model Units', 'stl_format' => 'ASCII'})
end

unless file_loaded?(__FILE__)
  menu = UI.menu('Plugins')
  menu.add_item('Export STL') {
    self.export_stl
  }

  file_loaded(__FILE__)
end

  end
end

I guess its an import issue. Would you be so kind to point me to the right direction? Thanks!

Witko commented 7 years ago

Hmm, it seems it works. I was calling wrong ui item. i've just added require require 'sketchup-stl/exporter'

thomthom commented 7 years ago

As of SketchUp 2018, a native STL importer/exporter is shipped with SketchUp.