Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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
Solved! Go to Solution.
@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.
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...
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.
Ok. Thanks. Will look at it again. Seems overcomplicated for such a simple thing