#convert skp to obj
#every thumb is putted in a created dir with name of related skp model's name
#skppath is the residence of skpfiles
require 'sketchup.rb'
if(not file_loaded?("skp2obj.rb"))
plugins_menu = UI.menu("Plugins")
plugins_menu.add_item("skp2obj") {file_export}
end
file_loaded("skp2obj.rb")
def file_export
#skp file path
#beware the end "/" e.g. skppath ="i;/skp/skptest/model/error/"
skppath ="i;/tt/"
#open dir and loop all skps
dir = Dir.open(skppath)
begin
dir.each {|x|
next if x !~ /\.skp$/i
x = "#{x}"
sourcefile = skppath+x
x = x[0,x.length-4]
destdir = skppath + x + "/"
destfile = destdir + x +".obj"
#mak dir
Dir.mkdir(destdir)
#open modle file
Sketchup.file_new
status = Sketchup.open_file sourcefile
if (!status)
UI.messagebox "error; " + sourcefile
end
#export obj
status = Sketchup.active_model.export destfile
if (!status)
UI.messagebox "error; " + sourcefile
end
}
ensure
dir.close
end
UI.messagebox "Finished"
end
Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
C
Offline
Latest posts made by ccsing
-
RE: Looking for a batch export .skp to .dxf ruby