Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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 ?
Solved! Go to Solution.
compile error itself? Hope you have included header file
#include <ProRibbon.h> |
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> |
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
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.
Hi,
first, to build TK apps you need TOOLKIT license (extension nr. 14).
To see 'Save the Auxiliary Application User Interface':
See example: attached unlocked app, with tk_enable_ribbon_custom_save yes, no TK license, command exists, custom ribbon prepared - Save presents -> .rbn saved:
PZ
Hi,
I do not get the option 'Save Auxiliary application user interface' .
See Creo Parametric TOOLKIT User’s Guide (tkuse.pdf) Chapter 15:
Workflow to Add Menu Items to the Ribbon User Interface
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).
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
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).
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:
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
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
Hi,
what was the reason of error "Foreign program 'XXX' failed to initialize" ?
BR
PZ
hi,
location given in .dat file was improper.
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
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
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