cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

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

JBlackhole
16-Pearl

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

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

1 ACCEPTED SOLUTION

Accepted Solutions


@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.


Martin Hanák

View solution in original post

6 REPLIES 6
Chris3
20-Turquoise
(To:JBlackhole)

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;\

 

Thanks

Surely there must be a File/Open kind of approach

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...


Martin Hanák

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


@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.


Martin Hanák

Ok. Thanks. Will look at it again. Seems overcomplicated for such a simple thing

Top Tags