Gcode Unit Converter Plugin

Here is where you can drop off Examples of WORKING macros,plugins,Gcode programs , macro Wizards etc.
Please give a brief description of what it is and how it works.

Gcode Unit Converter Plugin

Postby Dan911 » Sun Sep 16, 2018 10:51 am

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Sun Sep 16, 2018 2:44 pm

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby ger21 » Sun Sep 16, 2018 4:11 pm

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.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Gcode Unit Converter Plugin

Postby Dan911 » Sun Sep 16, 2018 5:40 pm

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Mon Sep 17, 2018 8:54 pm

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Tue Sep 18, 2018 1:41 am

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 1202 times



Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Mon Sep 24, 2018 5:44 pm

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Mon Sep 24, 2018 10:33 pm

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. :?
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Tue Sep 25, 2018 12:17 am

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Gcode Unit Converter Plugin

Postby Dan911 » Tue Sep 25, 2018 12:46 am

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Next

Return to UCCNC TOOL BOX

Who is online

Users browsing this forum: No registered users and 5 guests