Export multiple components to DWG


Is there a way to export several components en masse from a Sketchup model to DWG files without having to export them first as SKP models and converting each SKP models to DWG files one by one by hand?


What are you starting with? You are asking this question in a SketchUp forum that implies you have a SketchUp model already.

I modeled everything from scratch with SketchUp and my supplier needs every component in DWG files in order to CNC the parts.

Do you mean separate dwg files for each component?


OK. There isn’t a native way to export separate .dwgs of the individual objects. You could export an .stl file of a selected object, select another one and make another export. Then you might be able to find a batch converter from .stl to .dwg or maybe .dxf.

What is it you’re modeling and how is the cutting to be done?

I’m modeling a set of furniture parts (150-200 components) made of flat prefinished panels (melamine).
The parts will be machined with an industrial CNC router.

There are applications that can import a SketchUp model file and lay out the parts for CNC cutting. Look at Get Fabber as well as Vectric CNC applications.

Maybe not the finest work of all times but I came up with a bit of ruby that exports all select component definitions of the component instances selected:

path = "R:\\SKP"; model_path = Sketchup.active_model.path; Sketchup.active_model.selection.grep( Sketchup::ComponentInstance ).map {|i| i.definition}.uniq.each {|d| d.save_copy(path+"\\"+d.name+".skp")}.map {|d| path+"\\"+d.name+".skp"}.each {|p| puts p; Sketchup.open_file(p, with_status: true); Sketchup.active_model.active_view.zoom_extents; Sketchup.active_model.export(p+".dwg")}; Sketchup.open_file(model_path, with_status: true)

It seems to work, takes a while to iterate over every file. I’m just posting it here in case it helps someone in the future (yes I’m speaking of you who came straight from Google looking for this).