[Plugin] DXF_export v0.0.4 (2011-10-28)

[Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Thu Oct 20, 2011 8:20 am

Hi,

I would like to share my plugin ...

Just copy the dxf_export.rb file in your plugins folder.
You'll find it in 'Tools->Export to DXF'

It outputs polygons|polylines|cirles|arcs|lines to DXF (contours only)
(2d orientation for circles and arcs :thumbd: these do not have a 3d one but the centerpoint is positioned in 3d space)
3d rotated circles and arcs will be output segmented (lines)

polygons, polylines, lines, 3d circles, 3d arcs as lines
2d cirles, 2d arcs as circles and arcs (NOT lines) !!!

I did this because I use the DXF with heekscnc to generate milling operations (G-Code).
Milling a circle or an arc is much faster than several lines ...

I had some trouble with the rotation of the arcs but I think I did it :ecstatic:


dxf_export.rb


History:
*** v0.0.4 (2011-10-28)
- fixed arc orientation (finally?)
- model won't be exploded anymore
- 3d rotated circles & arcs export to lines


*** v0.0.3 (2011-10-22)
- fixed arc orientation
- improved objects assignment ( faster)
- corrected calculations ( x/2 returned int and not float as needed :oops: )
- automatic unit detection (to be tested ;) )

Any arc orientation testers online? :?
:lol:

Comments still welcome!
Jörg
4
Last edited by joergber on Fri Oct 28, 2011 11:37 pm, edited 4 times in total.

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export

Postby Bep » Thu Oct 20, 2011 4:57 pm

First quick test ,and it workt fine

Thanks , :thumb:

Bep
0
User avatar
Bep 
 

Re: [Plugin] DXF_export

Postby derei » Fri Oct 21, 2011 7:18 am

Thanks a lot for this plugin!

I tested it and it seems to have some bugs as follows:
    -it explodes everything in model.
    -it doesn't export faces.
    -some arcs are oriented wrongfully. - funny fact is that the built-in SU8-PRO exporter does the same.
    -it behaves differently if everything in model is selected, or if nothing is selected.

-what DXF version does it export? (most milling software need DXF2000)

I also need DXF for CNC milling. I posted some request here: viewtopic.php?f=323&t=40311&p=357180&hilit=batch+dxf#p356582 . Maybe your plugin can be tweaked to batch export each Component Definition(/group?) in a different file, on same folder, using Definition's name?

Beloy you have:
-resulted (exploded) SKP file
-DXF from ALL SELECTED
-DXF from NONE SELECTED (it asked to export entire model)
-Image from NC HOPS (software for CNC Milling) which shows the wrongfully oriented arc.
2
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] DXF_export

Postby joergber » Fri Oct 21, 2011 8:31 am

Hi,

thanks for your comments!

This is a quick and dirty release ...
But I couldn't await to release it and see if anyone needs it's functionality.

About the bugs ...
-it explodes everything in model.
Yes! It explodes everything and then it loops through all edges and get's each connected.
That's the way I try to find 'Objects'.
I will change it to respect Groups and Components!
But first I have to get rid of the orentation problem of the arcs!!!!!!
-it doesn't export faces.
This plugin does not process any faces (by now ;) ).
-some arcs are oriented wrongfully.
I know :cry:
If anyone knows a solution ... ... ...
- funny fact is that the built-in SU8-PRO exporter does the same.
I didn't know :)
-it behaves differently if everything in model is selected, or if nothing is selected.
Not in my environment (but I changed the script a bit).
Pls. try again with the next release!
-what DXF version does it export? (most milling software need DXF2000)
Ups! I didn't care about any DXFversion!
Just took the first spec I found.
But in future I'll use DXF2000!

dereeei, thanks for all information!

Stay tuned!
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export

Postby derei » Fri Oct 21, 2011 8:53 am

I'm very happy that I could help ! :D Indeed, I'm very interested in the development of this script, I'll be glad to test the next releases.
For now, it doesn't bother me if it doesn't export faces, because for milling purposes, all I need are contours, arcs, circles, correct orientation and Layers (name, color).
Indeed, respecting components (and groups, but not necessary), it would be a great thing! But take care to not process each instance of a Component Definition, because that would be redundant. Also, as I mentioned in the earlier post, if the content of each component would be saved as separate file in a chosen directory, would be awesome :enlight:

:thumb:
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby joergber » Sat Oct 22, 2011 6:57 pm

Hi,

new Version v0.0.3 available!

I updated the text and the dl-link in the first post and added something like a version history.

Still feel free to comment ...
And use the plugin as often as you can :)

Greetings
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby blajnov » Sun Oct 23, 2011 10:39 am

joergber wrote:...new Version v0.0.3 available!........

Error persists arc oriented incorrectly.
0

blajnov 
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby joergber » Sun Oct 23, 2011 1:53 pm

blajnov wrote:Error persists arc oriented incorrectly.


Hi blajnov,

can you pls. provide the source .skp file?
So that I can reproduce here ...

I have drawn something similar and opened in heekscnc and freeCAD.
Both seem to be fine!

Kind regards
Jörg

2011-10-23.jpg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby blajnov » Sun Oct 23, 2011 2:59 pm

joergber wrote:........
Hi blajnov,
can you pls. provide the source .skp file?
So that I can reproduce here ...
I have drawn something similar and opened in heekscnc and freeCAD.
Both seem to be fine!
Kind regards
Jörg

I opened the exported file in DraftSight.
In AutoCAD 2008, similar.
And when you export, create a file with no extension dxf
Here skp files and dfx
0

blajnov 
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby Bep » Sun Oct 23, 2011 6:01 pm

My drawing imported exploded and flipped also.
I hope you get this fixed.

The audit report in Doublecad xt (free) reported:

AcDbArc(21). An invalid Normal direction (0 0 -2.54) was found. Validation: Invalid. Replaced by Normalized.
AcDbArc(22). An invalid Normal direction (0 0 -2.54) was found. Validation: Invalid. Replaced by Normalized.
AcDbArc(23). An invalid Normal direction (0 0 2.54) was found. Validation: Invalid. Replaced by Normalized.
AcDbArc(24). An invalid Normal direction (0 0 2.54) was found. Validation: Invalid. Replaced by Normalized.
AcDbCircle(25). An invalid Normal direction (0 0 2.54) was found. Validation: Invalid. Replaced by Normalized.
AcDbViewportTable(8). An invalid Viewport *Active missing was found. Validation: . Replaced by Created.
Audit recovered database.
AcDbBlockTableRecord(1D). An invalid BlockBeginId was found. Validation: Invalid. Replaced by Created.
AcDbBlockTableRecord(1D). An invalid BlockEndId was found. Validation: Invalid. Replaced by Created.
AcDbBlockTableRecord(1B). An invalid BlockBeginId was found. Validation: Invalid. Replaced by Created.
AcDbBlockTableRecord(1B). An invalid BlockEndId was found. Validation: Invalid. Replaced by Created.
54 objects audited
Total errors found during audit 10, fixed 10

Greetings,

Bep
0
User avatar
Bep 
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby TIG » Sun Oct 23, 2011 6:37 pm

The error report sounds like you are converting vectors from inches to cm when you should not - a vector [0,0,1] is normalized [0,0,2.54] is NOT. Only 'cm-ize' dimensions and leave vectors alone.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby joergber » Mon Oct 24, 2011 7:48 am

Hi,

as mentioned above, the plugin does not export to correct DXF2000 format!
By now (for example) arcs with startangle of 245° and endangle 13° can happen!
I am not sure if this will be interpreted correctly by all importers or Autocad ...
And there is no HEADER or TABLE section or any (ENTITIES only!)
But I'll correct this in a future release!

But I also noticed that my 'orientation-algorithm' was incorrect for arcs with odd number of edges ...
I realized that the z-normal tells me if the arc was drawn cw or ccw ...
Thanks to TIG, which gave me food for thought ;)

Bep:
Thank you for the report!
I'll try Doublecad xt ...!
(or let you generate the reports ;) )

TIG:
Yes, I converted everything although normals shouldn't.
Thank you!

Give me a day or two to
- 'fix' arc-orientation (again :oops: ).
- implement export of 3d oriented circles and arcs to lines ...
- support Faces (however :?: )
- respect Components
- not explode everything anymore!

Thanks again to everybody!
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby Dubman1013 » Fri Oct 28, 2011 2:04 pm

I imported this plug-in, when I select the items & export, it does not give me any file types to choose from, no DXF. Is there something I'm missing or is there another plugin to make this work? Thanks for any advice!

I just downloaded the new version, but it still does not give the dxf file type to save as. Any suggestion ?
0
Last edited by Dubman1013 on Mon Oct 31, 2011 7:48 pm, edited 1 time in total.

Dubman1013 
 

Re: [Plugin] DXF_export v0.0.3 (2011-10-22)

Postby derei » Fri Oct 28, 2011 3:47 pm

Thank you, Jörg ! Today I had the occasion to use the updated version of the plugin, as I had to export some sketchup drawings as DXF for CNC. Despite it turns some arcs in AutoCAD, they are right oriented in CNC Software, and that is what I'm interested in.
You made me very happy here! Good luck with the improvements :thumb:
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Fri Oct 28, 2011 10:53 pm

Hi,

new version v0.0.4 available ...
I updated the first post.

Have fun!
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Tue Nov 01, 2011 12:41 pm

Hi,

@Dubman1013
There is no filetype to choose from!
The Plugin takes the current skp-filename and exchanges '.skp' with '.dxf' thats all!
(For unsaved models the default filename is 'Untitled.dxf')

Just click 'Export to DXF' then choose the folder to save to and save the dxf.
Before saving you may change the filename to your needs!
(But don't forget '.dxf' at the end of the filename)

Have a nice day!
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby Gumleguf » Sat Nov 05, 2011 10:04 pm

Thanks for a great plugin! I just sent a .dxf file to a friend and he could open it perfectly in SolidWorks. Next step is to CNC the part. :ecstatic:

Edit: One thing. My friend just mentioned that when he opened the .dxf in SolidWorks it was in Inches even though I made it in mm. He could just change to mm, but still...
0

Gumleguf 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Tue Nov 08, 2011 2:27 pm

Hi!

Gumleguf:
I can not reproduce here ...
The only thing I could imagine is that you disabled the
'Display units format' setting (Window->Model Info->Units) but then there should have been a messagebox saying "Unable to detect the actual unit setting ...\nGenerate Output in inch?" and the whole DXF would have been 'inverted' because the units calculation factor is -1 in this case ...
(will be fixed in next release! :oops: )

Pls. let me know if the problem persists!
And maybe you do have a screenshot that could help or the .skp file of your model ... ... ... :D

Anyway, thank you very much for the feedback :thumb:

:?: More than 120 downloads and just this few problems/bugs/featurerequests/... :D

Enjoy,
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby Gumleguf » Tue Nov 08, 2011 2:36 pm

You are welcome, and thank you (!) for the plugin! :)

Here is an example of a sketchup that he says opens in Inches:

GMaxx_bagplade1_1.skp
0

Gumleguf 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Tue Nov 08, 2011 3:24 pm

Wohooo, that was fast :shock:

I exported without any problems ...

unitsProblem_001.jpg


Here is my output ...
unitsFactorProblem.dxf

Could you pls. send this file to your friend to doublecheck?
Could you pls. check the setting and try again?

:?: If you select the measure tool in SU ...
is the length displayed like '371,25mm'?

Thank you!

Cheers
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby utiler » Tue Nov 08, 2011 11:46 pm

Hi joergber,
Can you explain how this plugin differs to a standard SU export?
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Wed Nov 09, 2011 12:32 am

Hi,

utiler:
It might not have come out clearly ...
I'm using SU 8 free (just updated my profile :oops: )
And the standard dxf-exporter is for pros only ( as far as I know )

So ...
I don't know how it differs to standard SU export :?

Is there a specific reason why you are asking?

Respects
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby utiler » Wed Nov 09, 2011 1:16 am

Only that I'm using PRO and wanted to know the difference; that's all....

thanks for the explain! :thumb:
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] DXF_export

Postby marcomartim » Fri Nov 11, 2011 8:18 pm

dereeei wrote:I also need DXF for CNC milling.

joergber wrote:I did this because I use the DXF with heekscnc to generate milling operations (G-Code).
Milling a circle or an arc is much faster than several lines ...


Thanks for the plugin!
I also use SketchUp to create files for CNC cutting.
There is an excellent plugin to do the right Gcode in Sketchup, Phlatscript (SketchUcam)
For more information, visit the site:

http://www.phlatforum.com/

viewtopic.php?f=15&t=38150&p=337062&hilit=phlatscript#p337062

Hugs
0

marcomartim 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby derei » Mon Nov 14, 2011 2:17 pm

I just found a bug in the program. As seen in image below, the unit format is disabled (to not show it in dimension lines). But, the exporter doesn't recognize the units that I used and wants to export by default in inch. My suggestion: if there is a program limitation for this situation, to replace the YES/NO message box with a list box with all units available. So, if the exporter doesn't recognize the units, to let the user choose.

Another thing... I selected only the contour lines from a 3d object (the lines that formed one face), the exporter reported "one shape",but in DXF I had all lines exported of the solid. Is it possible to export ONLY what is selected? I mention that I was inside a component when I selected the outer shape of the face.
One more thing: it would be useful to have the possibility to export in XY plane for all 2D shapes, regardless they are oriented on a different plane.

This is the most useful DXF exporter I ever used. Actually, is the only one that is helping me :D
Thank you.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby joergber » Tue Nov 15, 2011 11:25 pm

dereeei:
I recognized too that my unit detection was not fool proof and added a listbox ...

It seems that we are working on similar tasks ...
since I came across the same problems than you.
Currently the exporter exports all connected entities of the current selection.
So selecting a contour of a object will export the whole thing

I am in the process of developing some kind of peprocessing tools ...
The first one will be a drop tool where you can select any face of a model and it will be copied to z=0 and rotated to ground plane.

But I'm neither familiar with Ruby nor Sketchup toolbars ...
So this will take some time ;)

Thanks again for your feedback!

We read!
Jörg
0

joergber 
PluginStore Author
PluginStore Author
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby derei » Wed Nov 16, 2011 12:09 am

@joergber
Why don't you simply use selected entities to build the dxf? Is more simpler for start... You can iterate trough all selected and check what are they. If there are edges only, use them to build a dxf. If there are also faces, add to dxf the edges that build that face.
Because selecting a face is simple by double clicking. Usually a tool that selects a face, will select only a planar face, not a curved one (like a cylinder). To select that, I think you have to take into consideration the edge smoothing angle. So, I'm guessing that double click on a smooth face is pretty fast to not require a select tool (for now, at least).

Thanks for still working on it :)
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby Gumleguf » Fri Nov 18, 2011 7:53 pm

Sorry for the late reply.

No, I haven't disabled "Display units format" and it still opens in inches:

units.JPG
0

Gumleguf 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby Gumleguf » Mon Feb 20, 2012 1:23 pm

Hi Jörg,

Maybe I'm doing something wrong but here's one problem I have.

1. I create a 100mm x 100mm rectangle with some random circles, see attached file "Untitled.skp".

2. Using your fine tool I export it as "Untitled.dxf".

3. To print out my drawing I open the .dxf file in eDrawings (from Solidworks, version 12.2.0.110) and press the print button. I then see a windows where the drawing is scaled to 1:18.3926?

4. If I change the "Active sheet" setting "To scale (1 to 1)" the result is that the drawing get's massive big - you can only just see a small corner of a circle on an A4 sized paper.

Isn't that strange? And by the way, if I print out from step 3 the actual rectangle on paper is something like 137mm x 137mm and *not* 100mm x 100mm.

/Greg
0

Gumleguf 
 

Re: [Plugin] DXF_export v0.0.4 (2011-10-28)

Postby cgprosjekt » Tue Apr 17, 2012 10:33 pm

Hello Jörg!
Just wanted to thank you for a wonderful plugin. We have struggeled alot with exporting .dxf files with true circle to our CNC machine software. And yours works perfect so far.
You really made my day! Thanks

br
Lars
0

cgprosjekt 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: anhhoang97nb, guanjin and 3 guests

Visit our sponsors: