Page 1 of 1

Subroutines

Posted: Sun May 03, 2020 3:27 pm
by gmm50
I would like to use subroutines to cut multiples of the same part.
I've read about templates but can't make that do what I want.

I want to design one part, make it a subroutine then place that part 10 times on my material and generate G code to run.

Reasons:
I want to make changes to only one of the parts.
We loose power quite frequently. So When that happens I would have some number of completed parts and some amount for unused material. Hopefully only 1 part is trashed.

The G Code I see generated seems to be absolute so that is a bit of an issue making it more difficult to use as a subroutine.

Thanks in advance.

Re: Subroutines

Posted: Tue May 05, 2020 6:56 am
by tonydude
Use the array tool.
array copy icon.PNG
array copy icon 2.PNG


Tony
question mark.PNG
also click on the question mark for how to do it

Re: Subroutines

Posted: Tue May 05, 2020 11:19 am
by Kayvon
In addition to the array tool that lets you create several copies of the same design, it looks like you're trying to resume where you left off if there's a power failure.

The simplest way to do this is to create a design with the array tool that TonyDude showed you and run the entire thing. If a power failure occurs, reset the machine back to its origin, edit the design file to delete the completed portions, and have it run the new file. The new file will skip the completed portions because you deleted them and work on the parts that still need completing.

G-code doesn't have "subroutines" as you've called them, so any solution will involve editing the g-code directly or changing the design file. Changing the design file like this seems like the simplest way.