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:

chook file name setting


Girus
 Share

Recommended Posts

Hi,

 

Does anyone know how to set the post (nc) file name programtically.

 

I don't want to post the nc file yet, just set the file name ahead of time so that when I manually press the post button I get the filename that I set by default, instead of the T.NC I normally get.

 

TIA

 

Girus

Link to comment
Share on other sites

The only time I need the nc_filename is when I post programatically with the run_post_exe_dll() and even then I path out my own NC file anyway.

 

Since it's a character pointer, you probably can modify it directly, though it seems weird in the grand scheme of things.

Link to comment
Share on other sites

Yes. This is weird. Maybe there is another way to set it?

 

How about if the MC people step in and help here. please!

 

I need to programtically set the file name and path. My chook program is generation the all of the drawing lines and I also must have a filename that corresponds with what was generated. Hand inserting it at post time is to much time consumming.

 

Girus

Link to comment
Share on other sites

I will programatically post at some point in time, right now I am doing manual operations (some) and some are programatically, but when I get the whole thing done in chook then I will post too. I am learning to crawl then walk and I hope some day Run!.

Link to comment
Share on other sites

Don't know if this will help but I've had some good luck with the postOps() function in combination with the run_post_exe_dll() function to create a custimized multipost chook.

 

postOps in M_NC.H

post_dlg_settings/post_settings in M_NCVARS.H

 

A very simplified outline of what it does is:

1) Use postOps/post_settings to get some limited user interaction (if needed). We've got the chook tweaked enough that this is now turned off by default.

2) Use postOps/post_settings to generate the text .nci file.

3. Run the heck out of run_post_exe_dll() using the nci file against various postprocessors.

 

Bryan smile.gif

Link to comment
Share on other sites

Thanks to Bullines and Bryan for your help on this.

 

After much aggrivation I have finally achived what I was looking for. I am going to post it here for anyone who may need to do the same.

 

code:

//	SetDestinationFilename

// ======================

// Changes the destination NC file name.

// an operation must exist in order for this to be

// successful.

// I - szFileName : the new complete path and filename.

// must be valid.

// Returns: true for success, false for fail.

static boolean SetDestinationFilename( char *szFileName ){

 

boolean succf;

operation op;

db_ptr_type d_ptr;

 

 

// clear the operation.

memset( &op,0,sizeof(operation));

 

// get the first operation.

operation_manager (&op,OPMGR_GET_FIRST_LIST,&d_ptr,&succf);

 

if (succf){

// copy the filename

strcpy (op.cmn.nci_name, szFileName);

// change it!

operation_manager (&op,OPMGR_REWRITE,&d_ptr,&succf);

if(succf){

// regenerate the operations.

operation_manager (&op,OPMGR_NCI_REGEN,&d_ptr,&succf);

} else

return false;

}else

return false;

 

// return true! success!

return true;

}

Enjoy!

 

Girus

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...