I’ve been diving into macros as a first time user of this code and have found it super interesting (and difficult).
I do a lot of slab furniture work and often times, I need to plot points for locations of cracks that I need to patch. I have been doing this manually - jogging the machine to the crack, writing down the X,Y coordinates, and plot several points in my CAD file to manually probe the location of the crack.
Ideally, I could set up one of the macro keys on my WMPG-6 (Pro5x10/EX/Centroid/CNC12) to write the current X,Y position and create a list in Notepad++. I would take that list into Rhino/Grasshopper where I would plot the points at once.
Looking around the forum, I had found an interesting thread regarding custom macros, and found it to be a great intro into how these codes work.
I thought I had found a possible solution from this thread. There is an existing macro in the “\cncm\system” folder named “probe_write_point_to_file” and I used that to rewrite “wmpgmacro4” in my macros folder for my user profile. Code below:
; Filename: probe_write_point_to_file.cnc
; Purpose: Write a point to the currently open data file
; Programmer: John Popovich
; Date: Nov 9, 2010
; Usage: G65 “/cncm/system/probe_write_point_to_file.cnc” X[x_position] Y[y_position] Z[z_position] D[skip_new_line]
; Where: x_position = x point
; y_position = y point
; z_position = z point
; skip_new_line = 1 to skip the new line
; Notes: A file must be open for output
; Copyright (C) 2011 Centroid Corporation, Howard, PA 16841
if [#24901] then M223 "%c %f " #20101 #24
if [#24902] then M223 "%c %f " #20102 #25
if [#24903] then M223 "%c %f " #20103 #26
if [#24904] then M223 "%c %f " #20104 #5044
if [#24905] then M223 "%c %f " #20105 #5045
if [#d != 1] then m223 “\n”
The macro won’t run when I have my machine on and notepad open. Is this something that will only run with a probe attached? Or am I going about this in the completely wrong way?
I have greatly appreciated all the knowledge in this forum - super inspiring!
Mahalo,
Scott