This plugin would be very useful if I could get it to work . Using SU version 8. Followed video instruction in this thread . Tried different folders etc.
Laptop is Win 10 64 bit.
Sketchup.open_file(C:/Users/12/Downloads/Projects/SketchUp/_Models/001.skp)
mod.save_copy(C:/Users/12/Downloads/Projects/SketchUp/_Models/_SU 8/001_v8,
Error: #<NoMethodError: undefined method save_copy' for #<Sketchup::Model:0x11a22be4>> C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/4JDu_BulkCopybyVersion.rb:70:in
main'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/4JDu_BulkCopybyVersion.rb:64:in each' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/4JDu_BulkCopybyVersion.rb:64:in
main'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/4JDu_BulkCopybyVersion.rb:29
For reference, this is the plugin code. Maybe there is a newer version?
#------------------------------------------------------------------------------------------------
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted.
#------------------------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#------------------------------------------------------------------------------------------------
THIS PLUGIN IS ANOTHER FIGMENT OF MY IMAGENATION AND IS NOT BASED ON OR COMPLY WITH ANYTHING!
#------------------------------------------------------------------------------------------------
IT WAS CREATED AND ONLY TESTED IN A WINDOWS ENVIRONMENT AND MAY NOT FUNCTION ON A MAC.
#------------------------------------------------------------------------------------------------
Name: Bulk Copy by Version
By: sdmitch
Usage: Plugins>SDM Tools>Misc Tool>Bulk Copy by Version
Note:
Date: Feb 2016
#------------------------------------------------------------------------------------------------
require 'Sketchup'
------------------ MENU SETUP ----------------------
unless $sdm_tools_menu
$sdm_tools_menu = UI.menu("Plugins").add_submenu("SDM Tools")
$sdm_Edge_tools = $sdm_tools_menu.add_submenu("Edge Tool")
$sdm_Face_tools = $sdm_tools_menu.add_submenu("Face Tool")
$sdm_CorG_tools = $sdm_tools_menu.add_submenu("CorG Tool")
$sdm_Misc_tools = $sdm_tools_menu.add_submenu("Misc Tool")
end
unless file_loaded?(FILE)
$sdm_Misc_tools.add_item("Bulk Copy by Version") { SDM::Bulk_Copy_by_Version.main }
file_loaded(FILE)
end
------------------------------------------------------
module SDM
module Bulk_Copy_by_Version
def self.main
mod = Sketchup.active_model
ent = mod.active_entities
sel = mod.selection
#
version = Sketchup.version.to_i.to_s
versions = ['0','0','All','3','4','5','6','7','8','2013','2014','2015','2016','2017','2018','2019','2020']
until versions[-1].index(version)
versions.pop
end
inp = UI.inputbox(["Save Version:"],["6"],[versions[2..-1].join("|")],"Save by Version")
if inp
ver = versions.index(inp[0])
path = File.dirname(mod.path)
path = Dir.pwd if !path || path==""
input_folder = Sketchup.read_default("BulkCopybyVersion","InputFolder",path)
from = UI.openpanel("From Folder:",input_folder,"*.skp")
if from
fdir = File.dirname(from).gsub("\\","/")
Sketchup.write_default("BulkCopybyVersion","InputFolder",fdir)
models = Dir[fdir+"/*.skp"].map{|m|File.basename(m,'.skp')}
output_folder = Sketchup.read_default("BulkCopybyVersion","OutputFolder",path)
to = UI.savepanel("To Folder:",output_folder,"temp.tmp")
if to
tdir = File.dirname(to).gsub("\\","/")
Sketchup.write_default("BulkCopybyVersion","OutputFolder",tdir)
Sketchup.file_new
for m in models
next if m=="." || m==".."
puts "Sketchup.open_file(#{fdir}/#{m}.skp)"
Sketchup.open_file("#{fdir}/#{m}.skp");
unless ver == 2
puts "mod.save_copy(#{tdir}/#{m}_v#{versions[ver]}, #{ver})"
mod.save_copy("#{tdir}/#{m}_v#{versions[ver]}", ver);
else
for ver in 3...versions.length
puts "mod.save_copy(#{tdir}/#{m}_v#{versions[ver]}, #{ver})"
mod.save_copy("#{tdir}/#{m}_v#{versions[ver]}", ver);
end
end
end
Sketchup.file_new
end
end
end
#
end
end
end