Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

NC FILE EXTENSION by chook


ksoufi
 Share

Recommended Posts

Hi All

in the .pst file post, I've

sextnc (no extension) and in cfg file there's no reponse to question 508. NC Program extension?

When I post (interactively), i obtain a file without extension OK good smile.gif

 

Now when using

nci_manager(NCIMGR_POST_ALL..) to post my MC8 file and being setting

nc_filename = test for example

Then in the Specify File Name to Write message box MC proposes, by default, test.NC

If Ok button pressed, there are two files created

test.NC empty

and test full

How to do to fix this problem confused.gif

Link to comment
Share on other sites

ksoufi,

 

I don't know if this will help or not. Below is some code I plan on later expanding out to a 'dual post' chook.

 

It works by first resetting question 91 in a pst file from the mastercam default post processor exe "MP" to the name of the chook. Say in this case "MYMP".

 

91. Name of executable post processor? MP

to

91. Name of executable post processor? MYMP

 

Now when 'posting' is called mymp.dll is called instead.

 

The code passes the arguments to the regular mp.dll and my customized arguments to my setup sheet pst(set) file by calling run_post_exe_dll.

 

The chook acts differently when called from nci_manager and using the post button in the operations manager. With nci_manager each run of run_post_exe_dll is sent to the default editor. With the operation post button, if edit is set, only the first instance is sent to the editor. I haven't had a chance to play around to see it this is a cfg file setting, pst file setting , or something else.

 

The nice thing about this chook is that it runs after the nci file is generated. Giving you time to do other things.

 

Also Make sure 'save nci file' is set or mastercam deletes the nci file after the first run_post_exe_dll and before the second run_post_exe_dll if called.

 

Bryan smile.gif

 

quote:

char temp_nci[FILENAME_MAX];

char temp_pst[FILENAME_MAX];

char temp_nc[FILENAME_MAX];

char setup_sheet[FILENAME_MAX];

 

 

//make copy of nci, pst, and nc file names

//post_args are only set when 'posting' and are cleared after

//the first of run_post_exe_dll below runs

strcpy( temp_nci, post_args[0]);

strcpy( temp_pst, post_args[1]);

strcpy( temp_nc, post_args[2]);

 

//change name and directory for setup sheet

strcpy( setup_sheet, post_args[0]); // nci name with path

reduce_filename(setup_sheet, "", setup_sheet, ""); //nci name only

build_filename(setup_sheet, geo_prefix, "XXX"); //nci name with mc8 file path

//XXX will get striped off by

//the post and replaced by sextnc

 

 

//strcat( temp_nc, ".nc.XXX"); //if sextnc is "" will remove XXX and leave .nc

//when run from post button and edit nc is set, this one is sent to editor

//the next instance is not.

run_post_exe_dll( "mp.dll", temp_nci, temp_pst, temp_nc); //post as normal

 

 

//setup sheet

run_post_exe_dll( "mp.dll", temp_nci, "U:PostSetupSheet.PST", setup_sheet);

//when run from post button send setup sheet file to editor

 


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...