Skip to main content
1-Visitor
December 30, 2018
Solved

Creo Object Toolkit C++

  • December 30, 2018
  • 1 reply
  • 7813 views

Hello community!! I read about how object toolkit c++ works and I have a query related to it. If I am not wrong visual studio is used as IDE/compiler to write, compile and run object toolkit c++ application code and link with object toolkit c++ libraries. Or is there an IDE/compiler of creo object toolkit c++ to compile and run the programs of object toolkit? I am confused regarding the role of otk_install_app, creotk.dat file and otk_install.sln directory which specifies visual studio solution. Awaiting your replies and suggestions...

Regards,

Rohan

Best answer by sully7

Hi, 

 

Yep, you are correct! Visual Studio is the compiler/IDE of choice for OTK Toolkit. 

 

To answer your questions:

  1. otk_install_app
    • This is an example application provided by PTC, it has a few example applications, and if I remember correctly, I believe it has the source code to match as well. It's a great resource for learning!

  2. creotk.dat
    • The ".dat" file is the way to get Creo Parametric to load your toolkit applications. You can  The name of the .dat file does not matter at all (for instance, we call ours, "cadactive.dat") 
    • The "manual" way to load the Toolkit application is through the "Aux Applications" button in the ribbon of Creo P
    • The "automatic" way to load the Toolkit application (where the app is loaded when Creo loads) is to configure a config.pro setting for "creotkdat" (or "protkdat") to point to the ".dat" file that you have created.
    • The file only contains a few required lines - which point to the binary (the DLL or EXE) as well as the "TXT Directory" (which is used for any resources required for your toolkit application, such as images, icons, GUI resource files, etc)

  3. otk_install.sln 
    • This is an example visual studio solution created by PTC. If I remember correctly, you should only really need to set a windows Environment Variable in order to get the solution to recognize the C++ libraries and Header Files.
    • Otherwise, to start a new Visual Studio project from scratch, you can set the project properties (or create Visual Studio Property Sheets) to point to the required folders and settings.

 

Another thing to note, is that you'll need the correct VERSION of Visual Studio.

  • Creo 2 = Visual Studio 2010
  • Creo 3 = Visual Studio 2012
  • Creo 4 & 5 = Visual Studio 2015

You can still USE a newer version of Visual Studio (such as VS 2017), however the "Platform Toolset" used to compile against the PTC libraries in the project will need to be per the appropriate version of Creo.

 

Hope this helps!

 

Thanks,

James Sullivan

1 reply

sully714-AlexandriteAnswer
14-Alexandrite
December 30, 2018

Hi, 

 

Yep, you are correct! Visual Studio is the compiler/IDE of choice for OTK Toolkit. 

 

To answer your questions:

  1. otk_install_app
    • This is an example application provided by PTC, it has a few example applications, and if I remember correctly, I believe it has the source code to match as well. It's a great resource for learning!

  2. creotk.dat
    • The ".dat" file is the way to get Creo Parametric to load your toolkit applications. You can  The name of the .dat file does not matter at all (for instance, we call ours, "cadactive.dat") 
    • The "manual" way to load the Toolkit application is through the "Aux Applications" button in the ribbon of Creo P
    • The "automatic" way to load the Toolkit application (where the app is loaded when Creo loads) is to configure a config.pro setting for "creotkdat" (or "protkdat") to point to the ".dat" file that you have created.
    • The file only contains a few required lines - which point to the binary (the DLL or EXE) as well as the "TXT Directory" (which is used for any resources required for your toolkit application, such as images, icons, GUI resource files, etc)

  3. otk_install.sln 
    • This is an example visual studio solution created by PTC. If I remember correctly, you should only really need to set a windows Environment Variable in order to get the solution to recognize the C++ libraries and Header Files.
    • Otherwise, to start a new Visual Studio project from scratch, you can set the project properties (or create Visual Studio Property Sheets) to point to the required folders and settings.

 

Another thing to note, is that you'll need the correct VERSION of Visual Studio.

  • Creo 2 = Visual Studio 2010
  • Creo 3 = Visual Studio 2012
  • Creo 4 & 5 = Visual Studio 2015

You can still USE a newer version of Visual Studio (such as VS 2017), however the "Platform Toolset" used to compile against the PTC libraries in the project will need to be per the appropriate version of Creo.

 

Hope this helps!

 

Thanks,

James Sullivan

1-Visitor
May 9, 2019

Hi Mr. Sullivan,

 

You`ve mentioned using the correct "Platform Toolset", but what is it exactly?

 

My team is having similar issues, and the knowledge would we much appreciated.

 

Thanks in advance!