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...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement