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:

More SDK Questions


Recommended Posts

1. I am trying to run a post processor from a nethook and it seems like the routine I need to use is run_post_exe_dll(), but the documentation is a bit vague as to what arguments I need to give it. I have retrieved what seems to be the post processor name using PostProcFileStr() but I need to know what to put in the other 3 arguments.

 

2. I want to write a solid to an STL file but calling wr_stl() gets a fatal error. Does anyone have any experience using this?

 

Thanks for any assistance anyone can provide.

Link to comment
Share on other sites

quote:

1. I am trying to run a post processor from a nethook and it seems like the routine I need to use is run_post_exe_dll(), but the documentation is a bit vague as to what arguments I need to give it. I have retrieved what seems to be the post processor name using PostProcFileStr() but I need to know what to put in the other 3 arguments.


With versions prior to X, it was pretty straight-forward. run_post_exe_dll() took four parameters; post EXE filename, NCI filename, PST filename and NC filename.

 

But in the X SDK documentation, you're right. It's not helpful at all. So maybe it's the same as it was in previous versions (assuming that the new CD/MD stuff doesn't change things)? But indeed, as you've found out, if you're not familiar with the previous SDKs, the documentation makes absolutely no sense. Take what you will from "string passing in parameter #1 to the post", "string passing in parameter #2 to the post" and "string passing in parameter #3 to the post" eek.gif

Link to comment
Share on other sites

Bullines,

 

Thanks for the response. I did find a variable called post_args[3][FILENAME_MAX] but unfortunately it only contains zero length strings. Where do I get the 3 filenames from? Are they provided in the SDK or do I need to provide them? I found 2 routines NCIFile() and NCFile() in the documentation which sound as though they return the filenames but I cannot find them anywhere in the SDK libraries.

 

Thanks again.

Link to comment
Share on other sites

Prior to X, the other three variables that you could use were nc_filename, nc_filename, and mpost_filename. And of course, you could override those with your own paths.

 

But in X, I have no idea where it is. CD/MD has changed how it all works. Searching the CHM of the X SDK documentation for something like "NC filename" yields a few different possibilities. Maybe somebody from CNC Software can give some insight? confused.gif

Link to comment
Share on other sites

Wish I'd seen this thread earlier. Wouldn't have wanted to leave you hanging this long. You need to include the machine def header

 

#include "m_core.h"

#include "m_post.h"

#include "m_machinedef.h"

 

which is where the nci paths come from. There's some functions in there that reference the machine def to get these values. CaKiwi (Calafornia Kiwi? Like the fruit?) seems to have found two of them. Bullines's comment about the order of arguments is correct.

 

In any case, the call ends up looking like this.

 

//strMpPath is local, please substitute MP.DLL path

run_post_exe_dll (strMpPath.GetBuffer(0), NCIFile().GetBuffer(0),

PostProcFile().GetBuffer(0), NCFile().GetBuffer(0));

 

You don't actually need to touch the post_args[3][FILENAME_MAX] variables.

 

Happy Coding

___________________________

Jon Griffin

Software Engineer

CNC Software

Link to comment
Share on other sites

Jon,

 

Thanks for the reply. I'm getting an unresolved symbol when I link with NCIFile(). I assume it has something to do with name decoration and that I need to set some option in my project. Any help you could give would be greatly appreciated.

 

CaKiwi (California Kiwi, like the person from New Zealand)

Link to comment
Share on other sites

The function is in MCMachineDef.lib. Runiing the MSVC utility depends on MCMachineDef.dll shows it as:

 

?NCIFile@@YAAAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@PAU_group_list@@PAD11@Z

 

I don't know what all that means but maybe it will mean something to you

Link to comment
Share on other sites

This is a common problem for new chooks. You need to make sure you have the .lib file included, then go back and make sure that you have both the debug and release versions of it, each excluded from each others builds. This should clear up your issue.

 

Also, you need to #include (it's MFC) if you haven't already, to get access to CString.

 

_______________________

Jon Griffin

Software Engineer

CNC Software

Link to comment
Share on other sites

I fixed the unresolved symbols by upgrading to VS .NET. I was using VS 6.0 (despite the fact that the documentation plainly states that it is no longer supported).

 

Now that I am running the post successfully, my next question is how can I set the post processing options, such as not editing the NC file when the post completes.

Link to comment
Share on other sites

I have been led to believe the routines I need to get and set the post processing options are GetPostSetting() and SetPostSettings(). My knowledge of C++ is limited and I am having trouble calling them. If I do it like this

 

post_dlg_settings pds;

CCNCControl::GetPostSettings(&pds);

 

I get a syntax error

 

c:TempTest.cpp(154): error C2352: 'CCNCControl::GetPostSettings' : illegal call of non-static member function

 

If I do it like this

 

post_dlg_settings pds;

CCNCControl c1;

c1.GetPostSettings(&pds);

 

it compiles and runs, but the data returned is uninitialized. Any help would be greatly appreciated.

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