Marc,
Macro programming isn't proprietary the EDM world, but there are differences in the machine controls that may require some format modifications or Macro Variable address changes. I’ve provided a program below using Macro Variables for Rectangles for Die Cavities, and this was created for Makino machines. This program has a lot of notes in it to explain what it’s doing, but you might also have to change some of the special function G-Codes for your machine. This program is formatted for the Makino Wire EDM, and this program is using a Rotation command (G68 / G69) that is fairly common, but I’m also using a special M90 & M08 command that allows you to process and change the Tab length during the Rough Cut. I hope this helps!
************************************
(Rectangle Macro-ABS)
(Absolute Positioning - Processes CCW)
(User must enter values for Macro Variables 900 thru 907)
(Input variables are for X & Y axis size and corner radii)
(Program uses Indirect E & D values)
(Start Point is at zero in the Center of geometry)
(BRP-Makino 12-2004)
(Marco Variables)
#900=1.00000(X-axis Size)
#901=0.50000(Y-axis Size)
#902=0.10000(Corner Radius 1)
#903=0.10000(Corner Radius 2)
#904=0.10000(Corner Radius 3)
#905=0.10000(Corner Radius 4)
#906=0.10000(Stop/Tab Length)
#907=0.000(Rotation Value-3 Place Decimal Only)
(Main Program)
G90
G500G54
G0X0.Y0.M06
M90P1S1Q0L1R(#906)
G68X0.Y0.R(UDIV(#907)*1000)
E1D1 (Rough Cut)
M17
G41G1Y(#901/2)
G1X-((#900/2)-#902)
G3X-(#900/2)Y((#901/2)-#902)R(#902)
G1Y-((#901/2)-#903)
G3X-((#900/2)-#903)Y-(#901/2)R(#903)
G1X((#900/2)-#904)
G3X(#900/2)Y-((#901/2)-#904)R(#904)
G1Y((#901/2)-#905)
G3X((#900/2)-#905)Y(#901/2)R(#905)
G1X0.
M08
G40Y0.
E2D2 (Skim 1)
G41G1Y(#901/2)
G1X-((#900/2)-#902)
G3X-(#900/2)Y((#901/2)-#902)R(#902)
G1Y-((#901/2)-#903)
G3X-((#900/2)-#903)Y-(#901/2)R(#903)
G1X((#900/2)-#904)
G3X(#900/2)Y-((#901/2)-#904)R(#904)
G1Y((#901/2)-#905)
G3X((#900/2)-#905)Y(#901/2)R(#905)
G1X0.
G40Y0.
E3D3 (Skim 2)
G41G1Y(#901/2)
G1X-((#900/2)-#902)
G3X-(#900/2)Y((#901/2)-#902)R(#902)
G1Y-((#901/2)-#903)
G3X-((#900/2)-#903)Y-(#901/2)R(#903)
G1X((#900/2)-#904)
G3X(#900/2)Y-((#901/2)-#904)R(#904)
G1Y((#901/2)-#905)
G3X((#900/2)-#905)Y(#901/2)R(#905)
G1X0.
G40Y0.
M07
G69
M30
************************************