Skip to main content
16-Pearl
February 17, 2020
Solved

"executing" a .vb file (as-is) how to?

  • February 17, 2020
  • 2 replies
  • 3007 views

to all

 

A silly question. I am reading the vbapi user's guide (still early days) and I cannot find  how to "execute" a .vb file as-is. By that I mean read a .vb file in CREO so that it is executed straight away. (no compilation, etc done). Is this possible? if 'yes' how ?

 

Thanks

Regards

Best answer by MartinHanak

@JBlackhole wrote:

I am simply making my 1st step in the CREO automation capabilities.

Assume I have a .vb file, can I run the file 'as-is' so that the programme is "executed"? I do that a lot with another CAD package with which I can simply "play" the file. No need to create a .dll or .exe


Hi,

https://community.ptc.com/t5/Customization/How-startup-application-with-VBapi-in-Creo-Parametric-2-0/td-p/55347 tells you that:

The way the VBAPI works is that an external program is started and either starts Creo or finds a link to a running copy of Creo. The external program adds the button to the menu and then waits using a Listener to report that the button was pushed. When the button is pushed the external program does whatever it's told to do when the button is pushed.

This means that you cannot put your VB-code directly into Creo and execute it.

You must create "external application". I think you can put your VB-code into MS Excel and execute it.

VBAPI User Guide contains Example section ... you can test set of examples which are available in Creo installation.

2 replies

Chris3
21-Topaz I
February 17, 2020

I am not a API expert so there is probably a better way to do this through one of the APIs but vb files can be called through mapkeys.

 

 

mapkey(continued) @SYSTEMDriveLetter:\\Folder\\SubFolder\\script.VBS;\

 

16-Pearl
February 17, 2020

Thanks

Surely there must be a File/Open kind of approach

24-Ruby III
February 18, 2020

Hi,

please explain what action do you want to execute using .vb file.

Maybe https://community.ptc.com/t5/Customization/How-startup-application-with-VBapi-in-Creo-Parametric-2-0/td-p/55347 provides some information concerning PTC Creo VBAPI...

16-Pearl
February 18, 2020

I am simply making my 1st step in the CREO automation capabilities.

Assume I have a .vb file, can I run the file 'as-is' so that the programme is "executed"? I do that a lot with another CAD package with which I can simply "play" the file. No need to create a .dll or .exe

24-Ruby III
February 18, 2020

@JBlackhole wrote:

I am simply making my 1st step in the CREO automation capabilities.

Assume I have a .vb file, can I run the file 'as-is' so that the programme is "executed"? I do that a lot with another CAD package with which I can simply "play" the file. No need to create a .dll or .exe


Hi,

https://community.ptc.com/t5/Customization/How-startup-application-with-VBapi-in-Creo-Parametric-2-0/td-p/55347 tells you that:

The way the VBAPI works is that an external program is started and either starts Creo or finds a link to a running copy of Creo. The external program adds the button to the menu and then waits using a Listener to report that the button was pushed. When the button is pushed the external program does whatever it's told to do when the button is pushed.

This means that you cannot put your VB-code directly into Creo and execute it.

You must create "external application". I think you can put your VB-code into MS Excel and execute it.

VBAPI User Guide contains Example section ... you can test set of examples which are available in Creo installation.