Skip to main content
16-Pearl
November 8, 2023
Question

Adding buttons to the ribbon with custom functions

  • November 8, 2023
  • 1 reply
  • 2031 views

I've been using VB API for a couple of weeks now and now i want to add a button to the ribbon. But I can't even start an application in CREO. 
My code looks like this:

 

Imports pfcls

Module Module1
 Public asynconn As New CCpfcAsyncConnection
 Public conn As IpfcAsyncConnection
 Public session As IpfcBaseSession
 Sub Main()
 user_initialize()

 user_terminate()
 End Sub
 Sub user_initialize()
 conn = asynconn.Connect("", "", ".", 1)
 session = conn.Session

 End Sub
 Sub user_terminate()
 conn.Disconnect(5)
 End Sub

End Module

 

My protk.dat file:

 

NAME test
EXEC_FILE D:\Users\Creo_7\Test_Button.dll
TEXT_DIR D:\Users\Creo_7
STARTUP dll
delay_start FALSE
allow_stop TRUE
REVISION 2001
END

 

 config.pro:

 

protkdat D:\Users\Creo_7\protk.dat

 

What is a minimum requirements for creo VB application to run inside of CREO and how than can I add button on the ribbon?

 

Errors that I'm getting 

ilyachaban_0-1699450767676.png

ilyachaban_1-1699450775102.png

 

 

1 reply

24-Ruby III
November 9, 2023

Take a look here:

16-Pearl
November 9, 2023

VladimirN, thank you for those materials bu the didn't help me. 
Is there anything like this for VB API. I've found it in user guide for TOOLKIT.

ilyachaban_0-1699533105368.png

I'm able to start and use scripts that I have for now by running them in visual studio but I can't register application in creo. 

ilyachaban_1-1699533220094.png

 

24-Ruby III
November 9, 2023

Some solutions for this error: