Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Z Height from tool path Fusion Post Processor

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jstricklandZKXDP
217 Views, 1 Reply

Get Z Height from tool path Fusion Post Processor

currently searching for a way to output Z height from toolpaths in my post processor previously I just set it to leave 3mm of stock to avoid hitting pods (3 axis pod and rail cnc) but I'm finding I'm often inputting correct heights in fusion and neglecting to modify them after post processing to the proper heights, I've tried reading the source but with it being based on javascript (a language without strong typing) its a little hard to follow logically when the variable could well be anything. I've attached my current post, "konturfrasen" is the field in OnClose() that I'm trying to modify to output the correct Z height. (the post processor does not output gcode, it outputs mpr format files (ZA is the height field)

 

I've tried variations of machining[i].p.z, m.p.z, copying the declaration for xyz, all result in undefined. but it shouldn't be out of scope. I'm unsure what the root object is for obtaining the xyz coordinates from tool paths.

 

any help at all would be amazing, outside of this one quirk the post processor works flawlessly.

Thanks in advance. 

 

edit:

 To be clear on what I'm trying to achieve if I have a 3/4" workpiece and I set a contour to make a pass at say 12.7mm I would like to obtain the 12.7mm value to write in the post processor

1 REPLY 1
Message 2 of 2

Aight So not putting nobody down but I figured it out myself,

 

On page 131 of the post processor manual, above the getToolList() definition is a bit of code, this bit of code explains how to obtain the object that you need to get the parameter for the tool cut (in my case I reference cuts off the bottom because woodwop's Z Depth starts from the bottom for contours(not relevant but in case it helps anyone in the future pockets are opposite), (for example a Z depth of 3 leaves 3mm(1/8 of an inch) at the bottom of the stock)

 

so the parameter I use is "operation:bottomHeight_offset" which I have set to default to 3mm in fusion.

 

 

var doc = getSection(m.sectionId).getParameter("operation:bottomHeight_offset",999);
    if (doc == 999){
      doc = 3;
    }

 

 

In the example above, you can see we first obtain the Section (in the post mines based off of everythings setup already so ignore m for now) we then obtain the section ID(via m which is an array "machining" in the post I'm posting below) then ask for the parameter in this case "operation:bottomHeight_offset" IF that fails to return a value we set it to 999 and if doc becomes set to 999 we set it back to a sane value of 3mm (1/8 of an inch off the bottom of the stock)

 

y'all I tried every variation I could think of I really wish they had gone to a strong typed language for the post, a syntax error from a parser could have picked up on what I was doing wrong almost immediately, but persistence paid off I just now need to find a way to round up on the value to something not quite as insane as "9.524999999999999"

but I'm elated I got it working properly.

 

Update: Rounding achieved although it still leaves trailing zeros (which shouldn't affect anything operationally)

 writeVar("ZA", parseFloat(doc).toFixed(5));

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report