Hi all,
is there a way to get the field "Program name/number" in Setup, automatically filled with the part name?
Thanks
Solved! Go to Solution.
Solved by parobillard. Go to Solution.
Hi,
Do you mean about the gcode output or?
Can you show us the example how you would like it to look like?
Ivan Stanojevic
I mean the name of the postprocessed file, which is given by the "Program name/number" field.
We usually assign the drawing (part) name to the programs. With Heidenhain cnc you can use alphabet, numbers and special characters.
The name is usually long, so it would be nice to have the "Program name/number" field automatically filled.
For example, if the Part name is "abc" the "Program name/number" field should be "abc", and of course the postprocessed file will be abc.h (the extension depends on the postprocessor..)
I don't think there's a way to do this now (in the UI). It would be possible to write a small API script to drive the post process command, and you'd be able to specify the program name programmatically using that approach.
It's a good suggestion to make via IdeaStation.
Jeff
What software are you using?
I think there is a way to do it in postprosessor.
I do something similar. I "backup" every program I make with the part number as the program name.
Hum here's a bypass
It come with some problem.... at the end of the posting, it will open a logfile in the editor...
Anyway Try this:
In your post cps file,
Find the General variables decleration area (around the top of the file) and Add:
var originalPath = getOutputPath(); var newOutput = "";
In the "onClose()" function right after/under the " { " add:
var myPartName = hasParameter("inventor:Part Number") ? getParameter("inventor:Part Number") : "noName"; // Use Inventor part name //var myPartName = hasParameter("job-description") ? getParameter("job-description") : "noName"; // Use Setup name newOutput = FileSystem.getCombinedPath(FileSystem.getFolderPath(originalPath), myPartName + "." + extension);
Now look if you have the "onTerminate()" function. If not, at the bottom of the post cps file add:
function onTerminate() { FileSystem.moveFile(originalPath,newOutput); executeNoWait(newOutput,"",false,""); // This may not work!! }
It is working for me!
TRY AT YOUR OWN RISK
yes it is working for me!
What is it doing?
is it naming the file "noName"? If that's the case it is probably because you didn't saved the file
Infortunatly not. You will need a function/if then in the post, but these are only called after onopen, and the property window of the postprocessor is filled with everything before onopen.
Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.
Hi @nathardo. I know the problem sound simple, but to get the name you will need "getParameter" which only works after onopen. You get the filename window presented before onopen. Therefore the only way is to write the file and rename it afterwards.
Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.