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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Customization of toolbox in creo parametric

Sekar1
12-Amethyst

Customization of toolbox in creo parametric

Hi,

 

I want to implement a customized toolbar in CREO parametric toolkit.
I am using CREO 4.0 , M20. I have added  2 ribbons manually, when I tried to export ,
only  the .ui file is getting saved and  .rbn file is not getting updated .
And also I am not able to load  .rbn file through RibbonDefinitionfileLoad() command.
Does RibbonDefinitionfileLoad() requires CREO Direct license as well ?

1 ACCEPTED SOLUTION

Accepted Solutions

compile error itself? Hope you have included header file 

#include <ProRibbon.h>

View solution in original post

19 REPLIES 19

I don't think additional license is required. But I am not sure. What is return status of API while loading ribbon file? Is it not_found? What is your .rbn file location?

Hi,

 

RibbonDefinitionfileLoad() - Identifier is undefined.

This is what the error i get.

And toolkitribbon.rbn file is saved at C:\Program Files\PTC\Creo 4.0\M020\Common Files\apps\KeyShot\text and C:\Program Files\PTC\Creo 4.0\M020\Common Files\x86e_win64\cma\Plugin\text. 

compile error itself? Hope you have included header file 

#include <ProRibbon.h>
zemanekp
13-Aquamarine
(To:Sekar1)

Be carefull, I don't think that toolkitribbon.rbn from \KeyShot and \cma is your 🙂

To save your own, application related, .rbn use config.pro option tk_enable_ribbon_custom_save yes and Option button 'Save the Auxiliary Application User Interface' -> toolkitribbon.rbn should be at your application \text folder(We ussually move them into the \text\ribbon and change the name).

BTW: I recommend to save own rbn when you have set option load_ui_customization_run_dir=yes and there is any .ui file (any user settings applied). 

See CS115292.

PZ

Sekar1
12-Amethyst
(To:zemanekp)

Hi,

Thank you for the suggestion.

Can you please mention about the license?

Currently I am using CREO parametric 4.0, M20. I did not get the option 'Save the Auxiliary Application User Interface' while exporting. 

zemanekp
13-Aquamarine
(To:Sekar1)

Hi,

first, to build TK apps you need TOOLKIT license (extension nr. 14).

To see 'Save the Auxiliary Application User Interface':

  • you have to set tk_enable_ribbon_custom_save yes, if you don't have TK license (but your app was unlocked before),
  • or just use TK license with Creo session,
  • but you have to attach your app to Creo and your app should have some Commands prepaired (without commands there is nothig to save)

See example: attached unlocked app, with tk_enable_ribbon_custom_save yes, no TK license, command exists, custom ribbon prepared - Save presents -> .rbn saved:

2019-11-21 12_06_28-Creo Parametric.png

PZ

 

Sekar1
12-Amethyst
(To:zemanekp)

Hi,

 

I do not get the option 'Save Auxiliary application user interface' .

 

 
 
Sekar1
12-Amethyst
(To:Sekar1)

ptc_ticket.PNGptc_ticket1.PNG

zemanekp
13-Aquamarine
(To:Sekar1)

  • did you relaunch Creo with this option in config.pro?
  • did you run/start Creo with your app  - config.pro option protkdat (or creotkdat)?
  • is your app running at creo start?
  • (what kind of app (dll or exe)?)

See Creo Parametric TOOLKIT User’s Guide (tkuse.pdf)  Chapter 15

    Workflow to Add Menu Items to the Ribbon User Interface

Sekar1
12-Amethyst
(To:zemanekp)

Hi,

 

I missed the part of running auxiliary application. 

ie, Home -> Utilities -> Auxiliary Application

Register the .dat file which consists of path to the dll.

 

I used 'protk.dat' file which consists of the dll 'pt_inst_test.dll' which shows if toolkit is installed or not.

 

But when i tried loading my own dll, i got some error like "Foreign program failed to initialize". 

 

Please guide me on creating .dat file to load my own dll which performs some required functions (May be on an assembly or drawing).

 

 

zemanekp
13-Aquamarine
(To:Sekar1)

Hi @Sekar1 ,

yes, you can use this .dat file and change the names/pathes.

 

But I guess you don't have a Toolkit application at all.

What is "your own" dll? It is really Toolkit application?

Shortest code:

#include "ProToolkit.h"
int user_initialize()
{
return (0);
}
void user_terminate()
{
}

PZ

Sekar1
12-Amethyst
(To:zemanekp)

Hi , 

 

Yes it is toolkit application. The code is working fine.

 

could you please tell me in brief what are the steps to follow ?

 

I have the creo parametric toolkit license and a toolkit application with me (C++ code). 

zemanekp
13-Aquamarine
(To:Sekar1)

Hi,

in general, If you follow the TK User's Guide, it must work. 

Otherwise you have a mistake somewhere, and I can only guess where/what.

See  chapter:

  • Fundamentals (Registering a Creo Parametric TOOLKIT Application)
  • Creo Parametric TOOLKIT Registry File

Possible causes of Error "Foreign program 'XXX' failed to initialize" are described at artical: https://www.ptc.com/en/support/article?n=CS220487

 

So, how to rigister app is described in the documentation, I can only help you if I see what you're doing. You can send me your project - solution, source files, and your dll of app with \ text folder, dat file... (all zipped). I can check it.

You can sent it to private massage, or same cloud storage.

 

Issue could be at wrong project architecture or e.g at one character somewhere in path:)

I guess, it's not a valid TK application, or at least the correct TK library isn't linked.

 

BR

   PZ

Sekar1
12-Amethyst
(To:zemanekp)

Hi,

"Foreign program 'XXX' failed to initialize" issue is solved now. Thank you.

 

I am able to add a button now. When i try to add the 2nd button, it doesn't happen. Is it something to do with text folder or rbn files.

What all things should the text folder include ? 

 

Thanks 

 

 

zemanekp
13-Aquamarine
(To:Sekar1)

Hi,

what was the reason of error "Foreign program 'XXX' failed to initialize" ?

 

BR

   PZ

Sekar1
12-Amethyst
(To:zemanekp)

hi,

location given in .dat file was improper.

 

 

zemanekp
13-Aquamarine
(To:Sekar1)

OK,

so, at \text folder you should have msg_file.txt for ProCmdDesignate function with texts for each button.

(And to the \text folder will be save toolkitribbonui.rbn as we wrote before).

 

BR

   PZ

Sekar1
12-Amethyst
(To:zemanekp)

hi,

 

Any idea why do i get fatal error while launching creo ? 

 

The trace creation timestamp is: Sat Dec 07 15:15:34 19
The executable build timestamp is: Tue Jun 20 15:43:28 17
The datecode is: 2017110
The pro machine type is: x86e_win64
The process ID is: 12848
The traceback type is : CRASH
The logger exit status is: 01003

 

its there on traceback

 

 

zemanekp
13-Aquamarine
(To:Sekar1)

Hi, yes I have idea.

You defined proktdat config.pro option to startup your app after the creo lunch,

and you have error at your source code, which cuase e.g. some exception. That's my idea.

Which  function cause the error is roughly written to the traceback body (you sent only a header).

At least, exeption is bellow the header (as e.g. Exception EXCEPTION_ACCESS_VIOLATION...)

 

You can add'DELAY_START true' to .dat file, then lunch Creo, attach Visual Studio to the xtop.exe process and after that start your app from Auxiliary Application dialog. At this moment you will see exception, and go back through Call Stack (to identify problem). You have to debug your app.

 

I guess.

 

To be honest, if you're a beginner at Creo customization, and you need to deal with other issues, make new relevant question on the main wall.
And it is very useful, for everyone who solve similar problems, to describe the solution, where your problem was. And to help you, it is very important to provide more information to everyone who would like to help you. We can't just guess what you're talking about and what's happening to you.

 

BR

   PZ

Top Tags