# Convert .skp to .obj together

**URL:** <https://forums.sketchup.com/t/convert-skp-to-obj-together/10539>\
**Category:** Ruby API\
**Created:** [April 26, 2015, 12:59pm UTC](https://forums.sketchup.com/t/convert-skp-to-obj-together/10539 "2015-04-26T12:59:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![TIG](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tig/32/198_2.png) [@TIG](https://forums.sketchup.com/u/TIG)\
**Post date:** [April 28, 2015, 7:30am UTC](https://forums.sketchup.com/t/convert-skp-to-obj-together/10539/5 "2015-04-28T07:30:49Z")

</div>

Here’s a fuller/better version that actually works !  
Save text into a file named `TIG-Export.rb`  
Use _Notepad++_ [PC] or `TextWrangler` [MAC] to ensure it is encoded as `UTF8-without_BOM`  
**Usage:** In Ruby Console,  
`TIG::Exporter.new("obj")`  
The passed argument let’s you export to any available file-format…

```
# encoding: UTF-8
### v2015
module TIG
    module Export
        def self.new(typ="obj")
            dir = UI.select_directory(title: "Select folder of SKPs...")
            return unless dir
            dir.tr!("\\", "/")
            puts "#{dir}\n"
            pwd = Dir.pwd
            Dir.chdir(dir)
            Dir.entries(dir).select{|e| e =~ /[.]skp$/ }.each{|skp|
                    nam = skp.gsub(/skp$/, typ)
                    Sketchup.open_file(skp)
                    puts "#{skp} >>> #{nam}"
                    Sketchup.active_model.export(nam, false)
            }
            Dir.chdir(pwd)
            puts "\nDone."
        end#def
    end#module
 end#module

```

---

_[View the full topic](https://forums.sketchup.com/t/convert-skp-to-obj-together/10539)._
