Skip to main content
16-Pearl
Nov 8, 2023 1:21 PM UTC
Question

Adding buttons to the ribbon with custom functions

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

 

 

4 replies

24-Ruby IV
Nov 9, 2023 7:36 AM UTC

Take a look here:

Translate
16-Pearl
Nov 9, 2023 12:34 PM UTC

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

 

Translate
24-Ruby IV
Nov 9, 2023 12:55 PM UTC

Some solutions for this error:

Translate