Does Google Sketchup have a command line for exporting in 3ds or fbx format?

I am looking for a way to convert multiple skp, kmz or dae files at once to 3ds or fbx format. In sketchup pro you can export as ... 3ds or fbx, but it takes too long to open each file and export it. Is there a command line in sketchup or script that can be used to automate this process? Thanks

+4
source share
1 answer

you need to call a sketch from the command line, specifying a script to run immediately

sketchup.exe -RubyStartup d:\scripts\runexport.rb

in ruby ​​script ( runexport.rb ) you can

For a recursive directory walk, try this ruby ​​code (from wikipedia)

Compare patterns using regular expressions

 #define a recursive function that will traverse the directory tree def printAndDescend(pattern) #we keep track of the directories, to be used in the second, recursive part of this function directories=[] Dir['*'].sort.each do |name| if File.file?(name) and name[pattern] puts(File.expand_path(name)) elsif File.directory?(name) directories << name end end directories.each do |name| #don't descend into . or .. on linux Dir.chdir(name){printAndDescend(pattern)} if !Dir.pwd[File.expand_path(name)] end end #print all ruby files printAndDescend(/.+\.rb$/) 
+9
source

Source: https://habr.com/ru/post/1342998/


All Articles