Quick Macro Help

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Quick Macro Help

Postby Erphillips » Sat Mar 29, 2025 7:21 pm

Working on Linear ATC setup editing the G6 macro I have that's included with the 2022 screen set I use.
This line of code in my macro moves the spindle to the tool holder location to drop or pickup the tool.

exec.Code("G00 G53 X" + ToolX[Currenttool] + " Y" + ToolY[Currenttool]);
while(exec.IsMoving()){}

I need to move / offset the spindle -Y 3.00 so its in front of Holder Fork then Drop Z to proper height
then move +Y 3.00 to engage the fork before Releasing clamp and raising Z

I have defined...
double ForkOffsetDrop = -3.00;
double ForkOffsetPick = 3.00;
as the distance I need to clear or engage the Fork Holder

How can I add or subtract my ForkOffsetDrop or ForkOffsetPick to this line so it positions the spindle at the correct coordinate before moving Z

exec.Code("G00 G53 X" + ToolX[Currenttool] + " Y" + ToolY[Currenttool]);

I expect its easy and I just don't know the correct syntax and misplace ( or [ etc. so I get errors with everything I try

Thank You
Ed
Erphillips
 
Posts: 16
Joined: Sun Aug 20, 2023 3:03 pm

Re: Quick Macro Help

Postby Erphillips » Sat Mar 29, 2025 8:12 pm

All good

I copied and pasted the exact text from above in ChatGPT and it instantly gave me the exact answer I needed
Bottom line what I needed was...

exec.Code("G00 G53 X" + ToolX[Currenttool] + " Y" + (ToolY[Currenttool] + ForkOffsetDrop));

Copy and paste tested it and it worked perfectly.
First time I used ChatGPT and I don't think it will be the last!
Erphillips
 
Posts: 16
Joined: Sun Aug 20, 2023 3:03 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest