Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Anybody explain with example. thanks
Hi Keerthana,
Unlike the C++ API for "Object Toolkit" (OTK), which uses a session object - the C API for "Pro/Toolkit" doesn't actually have a "session" object that needs to get passed.
Here's some pseudo-code to get you started. NOTE: If you are using older versions of Creo/Wildfire, this code may change slightly.
void get_current_model_name() {
ProError err = PRO_TK_NO_ERROR;
ProMdl model;
err = ProMdlCurrentGet(&model);
if (err != PRO_TK_NO_ERROR) { return; }
ProMdlName model_name;
err = ProMdlMdlnameGet(model, model_name);
}
Be aware, you'll also have to add "#include <ProMdl.h>" to the top of your c file.
Please feel free to reach out if you have any questions.
Thanks,
James Sullivan