Use AutoHotKey to Automate Populating Fields in MakerCam

an open source, web based CAM package that works!
Post Reply
madhatter
Posts: 164
Joined: Sat Mar 21, 2015 1:33 am
Location: WA, USA

Use AutoHotKey to Automate Populating Fields in MakerCam

Post by madhatter » Sat Jan 02, 2016 7:31 pm

So, I tend to make a lot of cribbage boards, but fortunately/unfortunately I like to refine my designs, which involves a lot of re-coding the many, many holes on the board.

Backstory time - Skip down to The Good Stuff if you don't want to hear how I got to where I am now.

I started using Inkscape and MakerCam because they were free and I didn't want to pay for software before I found out what I really wanted to do with my SO3 since it was my first CNC machine. Found out that the two pieces of software do 80-90% of what I want to do, and the other 10-20% I can postpone for now. Deswigned my first cribbage board in Inkscape and when I went to make it in MakerCam I found out that MakerCam did not like all of the circles, since a bunch of them ended up in different locations compared to Inkscape. Even when I used the Path --> Combine, they still ended up in incorrect locations when opened in MakerCam. So I Started making a very small line (basically a 0.050 long line) and using that small dash as the center of the hole to be drilled.

That caused other problems, such as I was not zoomed in enough originally, and some of the holes were not drilled because they did not get selected. Sometimes I would watch my machine drill the same hole three times because they were accidentally selected multiple times. . . Ugh. . . Also, I was having issues with the occasional disconnect and then trying to re-zero the machine and find out where it was in the code to pick up where it left off. Oh. What. Fun.

So I started to zoom in and select only small groups - blocks of 20 holes (for a 4 player board, this was for the first 5 holes per player), and then if anything happened, I could find the block it stopped at and go from there. I also put the size of the bit in the name so I knew what bit it was intended for since I could not keep track of all the different sizes I was trying out. So, now my code for the cribbage boards looks like this:

Start Holes 1250
5 Holes 1250
10 Holes 1250
15 Holes 1250
...
...
120 Holes 1250


The Good Stuff


Now, having to populate the "Drill Operation" values 25 times gets old, so I remembered (much later than I wish I had) that I used to use a program called AutoHotKey to automate keystroke inputs, and I thought I'd try it again.
It took a bit of working on the timing, but I now have an AutoHotKey script (*.ahk) that can properly populate the values for whatever CAM operation you want to do in MakerCam. The code is edited with notepad, and is saved with the .ahk extension. You can edit it and re-run it to update it immediately. You can assign whatever hotkey you want to run the script. It is a really neat program. What I am doing is just scratching the surface of what the program can do, but it is great for this application.

Now, all I do is write in the operation and hit CTRL+1, CTRL+2. . .whatever hotkey I assigned to populate the values.


I have attached a few files to take a look at. Coding is simple. I had to add in a pretty large delay between each key stroke for it to be stable. Just remove the .txt and the files are ready to use.
Attachments
0625 Pocket.ahk.txt
(1.96 KiB) Downloaded 141 times
0236 Profile.ahk.txt
(1.7 KiB) Downloaded 104 times
1250 Drill.ahk.txt
(1.46 KiB) Downloaded 114 times
SO3 #0054
DWP611 - SuperPID
Prusa i3 MkII
SolidWorks 2015

WillAdams
Posts: 8514
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Use AutoHotKey to Automate Populating Fields in MakerCam

Post by WillAdams » Sun Jan 03, 2016 12:28 am

Ingenious!

(And I’m mortified and embarrassed not to’ve thought of this myself).

Wikied: http://www.shapeoko.com/wiki/index.php/ ... Automation
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

ArtFaks
Posts: 50
Joined: Fri Sep 11, 2015 8:37 am
Location: France

Re: Use AutoHotKey to Automate Populating Fields in MakerCam

Post by ArtFaks » Wed Jan 13, 2016 1:03 am

Waouhhhh !!! Just so amazing.... Thanks a lot @madhatter for sharing!
Shapeoko2 - Homemade CNC Control box - 400W/48V Chinese Spindle - Protoneer V3 Shield + DRV8825
Process - Illustrator > Makercam > UGCS

madhatter
Posts: 164
Joined: Sat Mar 21, 2015 1:33 am
Location: WA, USA

Re: Use AutoHotKey to Automate Populating Fields in MakerCam

Post by madhatter » Wed Jan 13, 2016 2:05 am

That'$ why they pay me the big buck$...
SO3 #0054
DWP611 - SuperPID
Prusa i3 MkII
SolidWorks 2015

ArtFaks
Posts: 50
Joined: Fri Sep 11, 2015 8:37 am
Location: France

Re: Use AutoHotKey to Automate Populating Fields in MakerCam

Post by ArtFaks » Wed Jan 27, 2016 12:02 am

Hahaha, yes of course, heineken is good ;-) ! I try to do the same thing as "AutoHotKey" with "TextExpander" on Mac OS!
Shapeoko2 - Homemade CNC Control box - 400W/48V Chinese Spindle - Protoneer V3 Shield + DRV8825
Process - Illustrator > Makercam > UGCS

Post Reply