cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

How to get the session and cuurent model name in protoolkit

kguru
1-Visitor

How to get the session and cuurent model name in protoolkit

Anybody explain with example. thanks

1 REPLY 1
sully7
14-Alexandrite
(To:kguru)

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

CadActive Technologies

President & Founder
CadActive Technologies - www.cadactive.com
Announcements


Top Tags