Use Path Rules to Set Post Variable

Is it possible to use path rules to set a post-processor variable? I am trying to set a post-processor variable so that contours with arcs or lines less than a certain size use a particular cutting condition on our laser. I’m not sure if this is possible, but i think the rule “On small shapes” may do what i am looking for. I found how to add specific code into the g-code file, but i am looking for a way to set a variable for the post processor. This is possible through an operation, is it possible through a rule?

Just wanted to bring this back towards the surface. Does anyone have any thoughts by any chance?

There isn’t any way to do this. I can’t see very many people wanting such a feature. I don’t like adding functions that get very little use because they end up making SheetCam more confusing to use for the majority.

I don’t like adding functions that get very little use because they end up making SheetCam more confusing to use for the majority.

I understand that concern. To be honest though, i dont see where sheetcam is difficult or confusing to use at all. I think it is an amazing program. There are a few quirks here and there that i am used to most programs having that sheetcam doesnt, but i suspect most of that stems from it being originally developed for milling and rotary cutting use and not plasma/waterjet/laser. Whatever functions i am refering to, there is always another way to do it. It has been very simple for me to learn to use and every button is pretty much self explanatory. My only issues, for the most part, seem to be from simply not knowing what functions are available. I think the majority of my non-programming questions have been “can i do…” and you already have that function, i just didnt see it.

There isn’t any way to do this.

Ok. If you dont want to consider adding it or if it would be a difficult addition, i am thinking about just using the existing path rules to write a line to the g-code file and post-post process it as you showed me in a previous post to edit the lines i need. I cont for the life of me find it, but it uses function OnFileClosed(). I’ll play with that and get back to you.

Thanks for all your amazing work Les!

The problem I have is that for a lot of users, SheetCam is their first experience with CAM and it can be pretty overwhelming. You obviously have a lot more experience so what to you is pretty self explanatory can be confusing for others. I have to try to balance functionality with ease of use. It can sometimes be difficult to know where to draw the line.

i am thinking about just using the existing path rules to write a line to the g-code file and post-post process it as you showed me in a previous post to edit the lines i need. I cont for the life of me find it

I think this is what you are looking for: https://sheetcam.discoursehosting.net/t/call-variables-from-another-tool/6425/8

That is exactly the post i was looking for, yes.

Could you explain a little bit what the path rule “On Small Shapes” does? What defines a small shape? arc radii and line lengths less than the set tolerance? Say i have a 10" square with a 0.1" notch. if the tolerance is .2" does that qualify as a small shape?

It is based on the length of the perimeter. The rule is applied if the perimeter is less than the value.

Ok, well what i was going to try to do wont work anyways. Nevermind. Maybe there isnt a one solution fits all to what i’m trying to do.

Can you not just pass an M-code so your machine knows to use a different setting before arcs and disable it after small arcs

Can you not just pass an M-code so your machine knows to use a different setting before arcs and disable it after small arcs

Unfortunately no, not in this case. Or at least not that i have been able to figure out so far… That is what i have done for our plasma and waterjet machines but this particular case is for our laser. This machine is a Mitsubishi ML3015eX CO2 Laser. The machine stores all the cutting parameters in a table of cut conditions. There are 12 different cutting conditions for each and every material thickness and type. Naturally we want to use the fastest, highest power condition as much as possible. But this does not work well on very small parts so sometimes the cut condition must be lowered. This can only be done at the start of every pierce. I was hoping to find a way to get sheetcam to choose a lower condition based on the size of lines and arcs in each contour, but i now see how that is so problematic to do. I am still looking into changing the condition mid-cut, but to no avail yet.

We started using sheetcam for the very reasons Les mentioned earlier. It is many times simpler and more intuitive to use than the software that came with the machine. But naturally with that comes less functionality. This is a fair tradeoff though because i can program something through sheetcam in 1/4 the time it takes to program a job with the laser’s own software.

I always seem to try to push the boundaries and get the most out of everything i can. Not always a good thing to do though.

Hey Les,

I figured out a way to do what i am looking for here, but i need your help again. Would it be possible to add a path rule that is “On Small Entities”? You have one that is “On Small Shapes” that is based on the perimeter length, but what i need is a path rule that is based on the individual entity length.

Say most of the part has lines that are 10+ inches long, but at the corners where bends are to be made there is a small relief cut that is a 0.040" by 0.080" rectangular notch. With the machine still on full power, it is just melting that notch all to crap. I am trying to make a way to reduce the power when the path gets to a small short move like this.

I realize this wont be perfect and that some arcs that appear to be a large continuous arc may be displayed as several short line segments and thus get caught by this rule, but its a start.

Thanks!

I see a lot of potential for that to mess up, depending on your drawing geometry. Would action points not be a better solution. Dmittedly you would have to manually place the action points.

Another workaround would be to modify the post to spot these short line segments.

Yeah, i got to thinking after i posted that, it really could cause more problems than benefits. It would be fine for the sheet metal parts i mentioned, but anything that has a larger contour made up of shorter segments it would just cut the whole thing extra slow.

Action points could be an option. How do you use / set up those?

And what do you mean by “spot” the short segments?

It’s pretty easy to calculate the length of the current segment. Take a look at the Mach3 THC with scriber post. It keeps a track of the distance travelled by adding up the individual segment lengths.

To set up action points select Mode->Edit action points. Click on where you want to place the action point to place it. If you hold the mouse over teh action point a box will appear with options such as length, feed rate and code snippets. Once placed you can drag each end of the action point to set it exacly where you want it.

It sounds like coding something in the post would be virtually the same as the entity path rule i mentioned, just without the option to lower the power some distance before and after the short segment. I cant picture how you would check for radius of curvature or proximity to other segments.

The action points sound like a lot of work, but may be the best alternative. Ideally i would love to have the process automatic, but i’m starting to doubt that is possible.

I had another thought on this in the middle of the night… what if the path rule would check the angle between these short line segments. Create a path rule “OnEntites” less than “x” length and direction change more than “x” degrees, then do “code”. Now yes, i believe i can do this coded into the post, but i do not see how i would be able to enact the code at some distance before this short entity. Thoughts?

I would like a better way to send messages to the post depending on path rules and action points. The workaround I use for now is to change the feed in the path rule or action pont. I save the base feedRate in OnNewOperation() and compare it with feedRate in OnSetFeed().

But I think it would be great if it was possible to run a post processor function from the code snippets. A preset function would be fine with the possibility to send a string as argument.

Maybe if it would be possible to trigger OnComment() by writing a comment in the code snippet.

I read the documentation and found that the notes tab is supposed to work like this. This works as documented for notes on operations and tools but not for notes on code snippets.

Is it intentional that notes on code snippets not generates a comment or is it a bug?

I never really thought about it. I’ll look into adding the notes in the next dev release.