Convert Sketchup SKP files to DXF or STL

Operating system: 
Windows and Macintosh
Program type: 
Sketchup script
License: 
Freeware

This is a plugin script for Google's free 3D design program Sketchup. The free version of Sketchup has limited file export options. Most CAM programs will not recognise the native Sketchup (SKP) file format. This plugin allows you to export your Sketchup model as a DXF or STL triangular mesh or as DXF lines, which should be readable by most CAM software.

To use the plugin, download the file below (skp_to_dxf.rb)  to the Sketchup plugins folder on your computer.

  • On a Windows PC. If you have installed Sketchup on the C: drive then this folder will be at C:\program files\google\google sketchup 7\plugins. 
  • On Mac OSX. The sketchup plugins folder is /Library/Application Support/Google SketchUp 6/SketchUp/Plugins

After copying this file, start Sketchup and you should now have an extra menu option (Export to DXF or STL) in the Sketchup Tools menu.

There are five export options:

  • DXF polyface mesh (recommended). This will give the most faithful reproduction of your original Sketchup model.
  • DXF polylines: exports the outlines of each face as a polyline, sometimes useful for CAM toolpaths.
  • DXF triangular mesh: breaks all the faces up into triangles
  • DXF lines. This option exports the edges in your model as lines.
  • STL  triangles. The stereolithography triangular mesh format, useful for some CAM programs.

The latest version has been optimized to work on large Sketchup models.

This plugin has not been tested extensively, use it at your own risk. Please post on the forum any problems or suggestions (no more comments below as the page is getting too big).

The latest version has major improvements by Konrad Schroder.

It might work on Apple computers: it has been tested on an Apple PowerPC G5 OSX 10.4.11. It works with Sketchup version 6 and Sketchup version 7.

Known limitations

The plugin will not work if you try to save the exported file in a location where one of the folders contains non latin characters, eg: "ą, ż, ź, ć, ń, ó, ł".

CAD/CAM software compatibility

The plugin's output is compatible with the following CAD/CAM programs tested so far: 

DXF: Cambam, Sketchup, A9CAD
STL: FreeMill, Vectric Cut-3D (evaluation version), Roland Modela Player, Boxford's 3D GeoCAM.

Please post on the forum if you can confirm compatiblity with other programs 

AttachmentSize
Old version of the plugin10.7 KB
Latest version skp_to_dxf.rb6.05 KB

Sliceforms

Thank you for this useful plugin.  I sometimes use Sketchup to make sliceform models, but had to retrace everything from a screenshot to get my pieces into a cutting file.  Yay!!!!! Now it is sooooooooooooo easy. 

 

Carol

Extreme Cards and Papercrafting

http://extremecards.blogspot.com

Redistribution

Hello, I was able to add to your plugin to call an external exe to convert the DXF into another format.  Would it be okay if I post the modified version of this plugin on my blog (delmiaquest.blogspot.com), attributing the original code to you?  I'd just like to make this available to other users of this software.

Thanks,

Jon

Redistribution is fine

Hi Jon,

Feel free to redistribute the modified code, I hope its useful,

Good luck

Nathan

Modification/redistribution

Hello, I used your plugin and was impressed how well it works.  I was able to add on to the end of the main routine so that after the export to DXF, it calls a conversion batch file I have for a piece of software I use, and translates the DXF into the software's native format.

I'd like to be able to give away my modified version of your tool, with attribution to this site, of course, for doing all the heavy lifting.

Let me know,

Thanks,

Jon

Plugin works only if skp model has faces

Hi, thanks alot for your great plugin. In my case (free google sketchup  6 on a pc), it works only in case the exported lines are part of faces in the model. If I export one or more single lines, I get the message from autocad that there is a missing layer specification on line 20 in the dxf file. Is this a known bug? Thanks for help.

On Intel Apple and OSX

So - I can't seem to get this to work on my mac - any ideas?

I have tried Sketchup 6 and 7
Having inserted skp_to_dxf.rb sketchup.app>package contents>Contents>Plugins nothing is showing in the tools menu - or any others for that matter.

OSX plugins directory

I haven't got a mac, but I checked the online Sketchup help files and it says that the Plugins folder on Mac OS X is at:

/Library/Application Support/Google SketchUp 6/SketchUp/Plugins.

Pleae reply if it works, I would like to confirm whether it works on the Mac.

Nathan

That seems to have done it

Thanks Nathan!

MacBook Pro OSX 10.5.7

SketchUp 7

worked on mac

Worked on my mac, you rock.

Thanks

Just used this to export a set of plans to DXF and it worked great. I had a few labels on my sketchup drawing however which didn't get exported, but no big problem.

Thanks Again!

circle errors

works great except for circles.
I draw in sketchup, export to dxf and import into A9cad.
Everytthing OK except for circles.

Cannot export file.

hey there,

i have copied the plugin into tSU folder.

went to the tools menu,
clicked Export DXF or STL
Chose Millimeters
Chose option : STL

then save location.

after i clicked save. no file seem to be created.
i went back and followed the steps and found out that below file name,
under save file type, it is blank.

is this normal? could this be a bug or am i doing something wrong...
it seems im jst that one step to what i need but i just cant get there...

thank you in advance

Denny

It sounds OK to me

Denny,

it sounds like you did everything right, so I don't know why it didn't work. Did you type in a filename for the STL file?

you can send your SKP file to me at  guitarlist.enquiries @ googlemail.com and I can check it.

Nathan

No way to convert

Nathan,

 

I have the same problem as Denny's with each kind of options (all DXF and STL).

It is also blank under save file type. Is there something missing ?

 

Are you able to do something for me ? 

 

Thank you in advance

 

Cédric

Great Plugin!!! Thanks.

BUT, I am not able to import these DXF files into my Autodesk Inventor 2009 or Autocad 2009 at my employer.

Within Autocad when trying to import the DXF, I get the error message....
"No layer specification for this object. on line 228. Invalid or incomplete DXF input -- drawing discarded."

Inventor just gives an import failure message.

Any ideas? Thanks so much for your efforts.

Missing LAYER table?

At the moment the plugin does not put a LAYER table in the DXF file, this could be the cause of the problem. Although the DXF specification allows drawing objects to be assigned to arbitrarily-named layers throughout the DXF file, perhaps these programs require all layers to be formally declared in a DXF LAYER table in the header section of the file.


I am investigating how to do this and whether it will be possible to add this feature.

I am sure that it is not a missing LAYER table, as the DXF specifications show it is not required: send me the problem DXF file to:

guitarlist.enquiries @ googlemail.com

Autocad 2009

I forwarded to you the SKP and DXF files.

THANKS.

Incomplete model exports

We have a similar problem here, because our model looks really weird after exporting/importing using this script. A short comparison leads to the fact that all lines are missing and only faces are exported. Thus we would so much appreciate you to fix this problem.

Thanks for this great work!

I have added this feature.

I have added this feature. Edges not belonging to faces are also exported in the DXF polyface mesh, polyline and triangular mesh modes. It might take a while for the file to propagate across the internet: make sure the plugin file has  "last edited june 30 2009" at the top of the file.

Thank you so much!

Thank you so much!

Missing lines in Polyface/Triangular mode

I just tested this nice export-script but unfortunately sole lines are not exported in Polyface and Triangular modes (only faces are exported). This makes all my models incomplete since all open curves are missing.

Could be a useful feature

I will look into adding this feature. At the moment polyface or triangular face export ignores anything that is not a face This feature is added in the latest version

Nathan

Exportador

Gracias !!

thanks very helpful.

thanks very helpful.

Troubles on OS X

I having trouble with this plugin on Sketchup 7 (paid, non-pro) for OSX. The simple test case is to draw a square face on the ground plane, select the face and then try to export the face to DXF. I have tried all DXF modes and STL and in all cases I get a dialog that says I've exported no objects. The DXF files themselves are similarly empty (they always contain: 0 SECTION 2 ENTITIES 0 ENDSEC 0 EOF). I have the latest version of the plugin. Any ideas on what I'm doing wrong?

I can't replicate this

I can't replicate this problem on my Windows PC, but I haven't got access to an OSX machine. Have you tried the old version? (you can have both installed at the same time, they do not interfere with each other).

lost cotation in DXF

Hello,

Try your plugin with QCAD 2.2.2.0, only dxf lines work on this. But i lost the cotation of my drawing... Stil a good job at all!

More information please

Thanks for the report, but I need more information: please could you explain what cotation means.

Nathan

Works better than Googles DXF 3D and 2D options

I am a sculptor and have been using sketchup to create my sculptures. When I am happy with my design I export to DXF and laser cut my parts in 2mm flat steel. I am having problems with googles DXF exports leaving gaps in lines and curves not meeting corners. So I downloaded your lastest file and exported my cut list as lines. It worked a treat. No gaps and all edges meet.

Tomorrow I will test it with the laser cutting software.

Cheers

Sketchup Crashes

hi, this plugin is EXACTLY what i've been looking for! only problem is, when i try and Export as DXF, it goes through all the option stages fine, but when it actually tries to save, it crashes sketchup.

this is the third time in a row it has happened now... is there a limit on the size of file it can handle? because the file i'm working on is realtively large for a sketchup model! if there is it may be worth me breaking down the model into components and handling them each individually.

mike

Try the new version of the script

Mike,

I think your problem is due to the slowness of the old version script. It prompted me to make a new version which is MUCH faster and works for large Sketchup Models. It works on the largest file I have, and hopefully will work for you. I also fixed a bug in the old version of the script whereby groups weren't getting transformed properly.

Nathan

DXF 2 TGA

Hi,
First I apologize for my bad Engglish.
I wrote a tool that converts DXF 2 TGA (for Second Life, where RGB becames XYZ) but I allowed only the 3D faces.
The only triangles allowed are in the bottom of the shape because this is the way for Second Life to recognize the start of the mesh.
My question is.
It is possible for your program to convert the DXF 3DFaces without cut them into 2 triangles?
The DXF allows 3DFaces even if they havent complanar vertex...
In this way we have two program that converts shapes from Google to Second Life and vice versa.
I havent problem to allow my program to resize the shape. Second Life needs xyz integer point in the range 0-255
My beta or CAD2Sculpty, is at
http://www.imitidicthulhu.it/C2Spage.html
B.R.
Jo

non-triangular 3D faces

Hi Jo,

Try the polyface mesh option in the latest version of the program

surfaces

Thanks !
I also am attempting to parse ( thanks to your basic routines ) in order to have the classic 3DFACE type AcDbFace so I search to optimize the surfaces.
I am far from the solution ( a lot of surfaces lost ) ... but I begin to understand the items of the SkUp database!
my work in progress is at http://www.imitidicthulhu.it/GoogleSkUp_2_dxf.zip
B.R.
Jo

non-triangular 3D faces

Many Thanks!
I am improving my progr im order to resize (0-255) and to put in the middle (center at 128,128,128) all type of shapes...
Jo

Thanks

Thanks for the plugin. It simplifies exporting the objects with straight edges. I'll have to find a way to import "holes" as circles in a way that I can dimension them in TurboCad.
Don

Arcs and Circles

I am working on exporting arcs and circles directly into the DXF file (instead of as lots of line segments). The AutoCad specification uses an object coordinate system (instead of a world coordinate system) which is giving me headaches, but I am making some progress,

Nathan

DXF entities

You're right Don, at the moment the plugin only limited number of DXF entities: lines, polylines or 3D faces. There's no reason why we can't incoporate other DXF entities like circles or arcs, or maybe even dimensions. I am still learning the DXF file specifications, and I will improve the plugin as I go.

DXF Script

Thank you,
Works well for me.
Paulo

Exporting DXF makes project huge size

Hello,

I used your plugin to export my panel project. When I import it back into sketchup the panel is 304+ feet length wise where as my original panel is only 1 foot long. Is this an error on my part? I want to create the dxf to have this panel cnc'd for me.

Sketchup import: unit options

Try this: when you are importing a DXF file into Sketchup there is an "options" button, this allows you to choose the units of the imported file. Make sure that these match the units you used for the original export.

skp to dxf

I'm kinda new to all this. Took a little CAD in school but nothing extensive. I am drawing up a design at work with limited resources. We are sending the design to Ohio Laser to have cut. When I tried to convert to dxf it worked but when we sent them the file they said it would not open infact it locked up their computers. Any suggestions? They asked if we could save as a pdf but like I said earlier we are limited to what we can do on work computers. HELP

There was a bug with the

There was a bug with the "export to DXF lines" option which is now fixed. Try exporting your file, and then re-importing it back into Sketchup to check whether it worked.

For laser cutter files have you tried Inkscape (www.inkscape.org)? It is a free program for Windows, Mac and Linux which is great for 2D work and has good options for DXF, PDF etc output. It is useful for turning bitmaps into vector files as well.

Exporting as dxf lines no longer works

Trying to export a dxf file as lines does not work. It creates the file, but then only writes a couple of lines, if any.

Export as DXF lines bug

Many thanks for reporting this.
Thanks to you this is issue is now fixed!

Nathan

Problems with files

Thanks for the program unfortunitly it only workedone time.

It will creat a file, but not a DXF... the Icon of the file is one of the windows (unknown program) files, and when you read the proporties it simply says "File type: File" instead of saying "File type: DXF"

Any suggestions?
Thanks!

File extension?

It sounds like the file extension (.DXF) has been left off the end of the filename. Try renaming the exported file by adding the ".DXF" to it. I will check the script to see whether this is something that should be done automatically.

DXF triangular mesh produces 0 bytes file on 7.0.8657

It's OK I fixed it (typo in script). Amazing! Thanks.

Marc

Thanks Marc

You're right there was a typo preventing the DXF-mesh export.

Thanks for letting me know! It's fixed now,

Nathan

DXF triangular mesh produces 0 bytes file on 7.0.8657

Great plugin. Congratulations! 2D DXF works great and STL seems to work (although I have nothing to read it with), but DXF triangular mesh always produces a file of size 0 bytes. Am I missing something? Using SketchUp version 7.0.8657 on XP SP3.

Marc.