Batch .dwg Importer
-
I have about 150 CAD drawings I have to import into SU. Does anyone have any suggestions to speed up the process?? It's driving me crazy to do each one manually. Thanks in advance.
-
Write a one liner something like this:
f='C;/Temp/DWGfolder';Dir.entries(f).each{|d|Skethcup.active_model.import(File.join(f,d),false) if File.extname(d).upcase==".DWG"}
Edit the part in the f='' to be the full-path to YOUR folder of DWG files.
Copy+paste into the Ruby Console + <enter>... -
dude! that is awesome!
-
TIG! Thank you!! I'll try it out and let you know how it goes.
Thanks again. -
That worked really well. It puts them all in the same file, so i'll still have to separate them but that still is a big help. I've never worked with the ruby scripts (besides downloading them) but it looks kinda fun. I'm gonna tweak that and if I come up with anything useful I'll share it.
-
You never said you wanted the DWGs importing so each went into a separate SKP file !
To do that you need a bit more code - start with an almost empty SKP add a small bit of geometry [dot at origin?] to force a new component on import; run the adjusted code, it gets the imported file name and imports it, saves the SKP with that name.skpe [into a given folder], then it erases the DWG-component and purges the SKP's definitions, and adds the next DWG and repeats saving as that name etc... until all DWGs should have been saved into separate SKPs...
Advertisement