Code Snippets

Hi Les, I’m new to the world of cnc plasma and the learning curve is steep. I’m using Fusion 360 for drawing simple shapes , saving the sketch as a dxf and then importing it into SheetCAM. I am trying come to terms with path rules and code snippets hence the reason for this question.
Environment: Win10x64 with TNG 7.1.22 evaluation
I have drawn a single circle 30 mm in diameter saved it as a dxf then imported it. All good. I select a suitable tool for the cut operation (inside offset),
no path rules, perpendicular lead in, no lead out, and use a code snippet to turn Arc voltage control off. I then post it. When I examine the g-code there are two instances of the code snippet - one after the other. :question: . OK, if I go back and edit the operation and re-post it then re-examine the g-code I see that there is still an instance of the code snippet remaining in the g-code. It never goes away. I’m now a bit confused.
This is where it gets a bit subtle.
I close the existing job by opening a new job.
I repeat the file import, select the same tool with the same options as previous with one exception - this time I don’t use a code snippet, I post it, examine the g-code and find no instances of the code snippet - all good. I then edit the tool operation and use the code snippet, re-post, examine the g-code - only one instance of the code snippet. All good. If I re-edit the operation and remove the code snippet - it disappears form the resultant g-code. :slight_smile: .
This behaviour is repeatable.
Essentially if you apply a code snippet to the first instance of tool operation when you first create the operation the snippet appears twice in the g-code and you are unable to remove one of them.

BTW - I like your work - its a magic piece of software - a license purchase is in the pipeline.


Set up a job that posts the double snippet then save it (file->save job). If you send me the job file I’ll take a look and see if I can figure out what is going on.

Please find attached the job file that produces two instances of the code snippet
TestCircle.job (14.2 KB)

I found the problem. It is a bug in SheetCam. Is this causing an issue for you at the moment?

Hi, no its not causing any issues. Now that I know what makes it happen I just avoid adding the snippet when I create the first tool and then go back and add it to the tool later on. I do have another question related to code snippets though. Would you like me to start another thread or will this one be ok?

Go ahead and ask it here if you want.

Hi Les, the question relates to path rules. In this instance its the “before end” rule. I’m using the same simple circle as before.
What I’m trying to do is to vary the feed rate near the end of the circle to see if it has any effect on divots.
Please excuse my ignorance but I am having difficulty with the relationship between the distance specified in the “before end” rule and the “include leadout” checkbox.
For example if I specify a leadout of 10mm in the tool operation and a “before end” distance in a path rule that is less than this (say 5mm) , apply the path rule to the tool operation and post it - the resultant g-code has the required change ( feed rate ) at 5mm before the end of the lead out - that sounds reasonable - I think that’s what I asked it to do. Where it gets interesting is if I want the feed rate change to occur slightly before we get to the leadout (in the circle) say at 1mm before the leadout starts. So I set the “before end” distance to 11mm. If I do this change when I re-post nothing seems to happen. - there is no feed rate change in the g-code - either in the circle or in the leadout. Is this the expected behaviour? The result is the same whether or not I have the “include leadout” checkbox ticked in the path rule.

Further to this:

If I edit the tool operation to set the lead out to none and re-post then the expected feed rate change appears in the g-code in the circle.

The issue seems to be that if I want to change the feed rate near the end of the circle and the tool operation contains a leadout then the “include leadout” checkbox will only produce feed rate change (and not in the circle) if the “before end” distance is less than the length of the leadout. If I want the feed rate change to occur in the circle itself I have to remove the leadout from the tool operation. Is that not the purpose of the “include leadout” checkbox?

Apologies if this seems to be a bit of a ramble .

Attached is the job file for 30mm circle, 10mm leadout, before end distance 5mm, do not include leadout, feed rate 150%.
Circle_PathRules.job (14.2 KB)