- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not sure about phrasing properly the title of my question.
Still working on the Roeders 5 axis post-processor. The way it is used, it generated a file for each operation/toolpath. Problem is, the subprogram file name is always the same "subx.rod", which is not very convenient after you process a dozen of parts....
So, I would like to add the document-path parameter to the filename. I saw that, if I get those parameters values at the top of the "onSection" function, it does works.
function onSection() {
if (isFirstSection()){
// BG Added to have the actual document name
if (hasParameter("document-path")){
var documentName = getParameter("document-path");
//writeComment(" --Document: " + documentName + " -- ");
}
// BG added to get the setup description before each operation.
if (hasParameter("job-description")){
var setupName = getParameter("job-description");
//writeComment(" --Setup: " + setupName + " -- ");
}
}
BUT, if I try to use "documentName" in subprogramCall, the value is undefined, so I guess it's called before. What would be the proper workaround ?
function subprogramCall() {
if (getProperty("useFilesForSubprograms")) {
writeBlock("XCALL " + documentName + "sub" + currentSubprogram + "." + subprogramExtension); // call subprogram
} else {
writeBlock("CALL LBL" + documentName + currentSubprogram);
}
}
As always, than you so much for your help,
Bernard
PS- Also, I notice theses parameters are under onOpen() in the dmp file, but I get "parameter does not exist" when I put my onSection code in the onOpen function. As I doubt the dmp file is wrong, I guess I am doing something wrong, but what ? I don't understand why I could not read these values, but the dump.cps can.
Blog : Le Bear CNC | Forum : Le Bear CNC Forum | Addin : Airfoil Sketch from file
Solved! Go to Solution.