Page 1 of 2

Gcode Unit Converter Plugin

PostPosted: Sun Sep 16, 2018 10:51 am
by Dan911
This plugin will convert gcode units inch to mm or mm to inch used in the UCCNC version release 1.2047. Any gcode not used in this version plugin won't recognize or convert. Will update with new official release versions upon request.


To use this plugin.

1. Put file in your UCCNC plugin folder and start UCCNC, go to configuration/general settings/configure plugins and check enable, restart.
2. You can create a button on your screen and give it button# 55555, or create a hotkey with Function # 55555, or create a macro and put "exec.Callbutton(55555);" in it. Call macro with mdi or multiple Macro Button plugin.

The plugin converted a file with 1,490,000 lines (46mb) without issue in testing. Hope some can find use.

Dan

gcuc.JPG



Gcode Unit Converterr.zip
(7.32 KiB) Downloaded 1254 times

Re: Gcode Unit Converter Plugin

PostPosted: Sun Sep 16, 2018 2:44 pm
by Dan911
Would be happy to but never used Scaling so not sure what needs to be done, the plugin is going to convert x,y,z ,a,b,c to mm or inch depending on what's configured. What I'm I missing?

Do you mean a different plugin to convert the scale?

Dan

Re: Gcode Unit Converter Plugin

PostPosted: Sun Sep 16, 2018 4:11 pm
by ger21
He wants to be able to make the code larger or smaller. Instead of 25.4x larger (inch to mm), maybe 2x larger.
Same code, just user specified scale factor.

Re: Gcode Unit Converter Plugin

PostPosted: Sun Sep 16, 2018 5:40 pm
by Dan911
Oh boy do I feel stupid! I was thinking G51 which I'm sure works same way but I only quickly googled, after just reading your PM it clicked what your after.

This can easily be done with this plugin by making 25.4 an editable variable. If you are working on this I can certainly help, or I can easily edit this plugin to do it...LMK

Dan

Re: Gcode Unit Converter Plugin

PostPosted: Mon Sep 17, 2018 8:54 pm
by Dan911
Vmax549 wrote:Yes to what Ger said. Scale everything up or down.

x1.5 = 1 and 1/2 times larger
x.5 = 1/2 the size

Also what I did for mach3 plasma was create a function to take a extents value of either X or Y and then set a new size and it gave you teh scale factor to use

For example:

Old size ( 12.000 ) New size (24.000) = scale factor of 2.000

(;-) TP


Hi Terry,

Since your idea and help was hoping you can test and suggest any ideas/recommendations to make more useful.

Vmax549.zip

Re: Gcode Unit Converter Plugin

PostPosted: Tue Sep 18, 2018 1:41 am
by Dan911
Thanks for your help Terry much appreciated!

The tab order is a simple fix and something I always overlook...LOL. The Cancel button is to stop the backgroundworker thread, you really wouldn't see it work unless it's a really large file and you wanted it stop before the conversion is finished.

Yes I worked with SaveFileDialog(), VS makes it very simple to implement. The plugin creates a folder in the UCCNC directory and saves files there, I use the same file for all plugins and feel it keeps all files in 1 place and makes it easier to remember where to find, also eliminates another step.

To use SaveFileDialog() in a macro is also simple, I uploaded in a test form to see. Write in textbox and press save button.

SaveFileDialog Macro.txt
(1.54 KiB) Downloaded 1203 times



Dan

Re: Gcode Unit Converter Plugin

PostPosted: Mon Sep 24, 2018 5:44 pm
by Dan911
I updated the plugin per Terry's request and suggestions, I think it can be very useful in the rare times that it's needed.

I took a Gcode file created with CnCdrive's free text engraver program, it only outputs mm, I than converted it to inch and scaled larger to my likings. I changed/added a few things such as
a scale preview and a help button to the plugin.

The attachment Capture.JPG is no longer available




Capture.JPG

Re: Gcode Unit Converter Plugin

PostPosted: Mon Sep 24, 2018 10:33 pm
by Dan911
Vmax549 wrote:HIYA Dan, are you sure you zipped up teh right version ?? It does not look like teh one on teh screen it looks like the OLD version.

(;-) TP


Certainly sounds like something I would do...lol

Just removed from my plugin folder, downloaded from here to a new folder and installed and all seems correct. :?

Re: Gcode Unit Converter Plugin

PostPosted: Tue Sep 25, 2018 12:17 am
by Dan911
Terry go to plugin configure and confirm 1.0003. Try deleting it from your folder and see if button or hotkey still calls it. Not sure what I can do all working here. Hopefully someone can confirm who is overlooking something. I tried several times with same results.

Dan

Re: Gcode Unit Converter Plugin

PostPosted: Tue Sep 25, 2018 12:46 am
by Dan911
Have to admit just happy to read it wasn't on my end, thought for sure it was and those 3 glasses of wine was giving me a mental block. :shock:

Let me know what you think, it was a great idea and THINK it's working well with the little bit testing I did.

Dan