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

Program name/number

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
beltorax
1795 Views, 15 Replies

Program name/number

Hi all,

is there a way to get the field "Program name/number" in Setup, automatically filled with the part name?

 

Thanks

15 REPLIES 15
Message 2 of 16
ivan.stanojevic
in reply to: beltorax

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


Message 3 of 16
beltorax
in reply to: 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..)

Message 4 of 16
jeff.pek
in reply to: beltorax

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

Message 5 of 16
beltorax
in reply to: jeff.pek

Ok, thank you!

Message 6 of 16
parobillard
in reply to: beltorax

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.

 

Message 7 of 16
beltorax
in reply to: parobillard

I use Free HSM for Inventor. What Solution do you suggest?

Message 8 of 16
parobillard
in reply to: beltorax

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

Message 9 of 16
beltorax
in reply to: parobillard

It works like a charm!

 

Genius!!

Message 10 of 16
beltorax
in reply to: parobillard

Too soon.. Does it work for you with more parts opened?

Message 11 of 16
parobillard
in reply to: beltorax

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

Message 12 of 16
nathardo
in reply to: parobillard

Great fix, just searched the forum becourse i have the same problem. But are there any expressions that can be used instead maybe like 'partfilname' and 'jobsetup name'. Then it could be set as default, an i would't have to "hack" all my postpro.. I think that could be awesome
Message 13 of 16
ArjanDijk
in reply to: nathardo

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.


Message 14 of 16
nathardo
in reply to: beltorax

Hmm not sure I fully understand. And maybe my problem is a little different than Beltorax. Did you see my picture?
I just want the nc-program to get the same name as my ipt-file. And if I write it in the stock-setup it's done.
Message 15 of 16
parobillard
in reply to: nathardo

@nathardo It is not possible in Inventor itself! The only thing you can do is in the post processor!

Message 16 of 16
ArjanDijk
in reply to: nathardo

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.


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

Post to forums  

Autodesk Design & Make Report