Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Bryan's menu and vbscript


Jody
 Share

Recommended Posts

I thought this was covered but couldn't find it.

Is there a way to run a vbscribt file from bryan's menu chook? I know that I can run the Mcamvb.dll from the menu, but then I have to find the vb file that I want to run. I would like to bypass the Mcamvb window for scribt that I run alot.

 

Thanks

Jody

Link to comment
Share on other sites

In its current implimentation the Menu chook can't. frown.gif

 

I'll look around in the chook documentation and see if there's a way to call a vbscript from a chook. If there is I'll try to add this.

 

If any of the chook gurus or someone from CNC knows how to call a vbscript from a chook and could tell me it would save me considerable time. biggrin.gif

 

Bryan smile.gif

Link to comment
Share on other sites

Mick,

 

Heeeeeeeeelp. eek.gif

 

Ok, I'm testing some code. I can load the dll and run the function no problem. biggrin.gifbiggrin.gif

BUT after the script ends, the script is then opened (not by me) in the vb editor. Does the function take more than One variable ( I know you said just the file name) or is their a noEditSciptAfterExit boolean I have to set?

 

Bryan smile.gif

Link to comment
Share on other sites

Rekd,

This is from inside a chook.

 

It's probably something like vb_prefix, vbs_prefix, scrpt_prefix. But that's assuming that the variable IS exported from the exe, AND it's included in othe obj files, AND its defined in the h files.

 

I assuming it's exported from the exe since the vbs chook probably needs to access it at some point. The definition from the h file isn't a problem. I can add that myself. But, if it not in the chook skd obj files (or not exported) that's a problem. I'll keep my fingers crossed.

 

Bryan smile.gif

Link to comment
Share on other sites

Mick,

 

if calling GetPathOfThisScript inside the chook via the vbs chook is possible it beyond me. confused.gif I just endup crashing MC. I don't think it would help anyways I need the vbs path so to tack on the users vbscript then send it to the chook.

 

I think I'll partial softcode it off the application path and tack on vb for now.

 

too bad their isn't a function like execute_func and execute_dll then all of this would be moot. I could just pass the script name to the function and be done with it.

 

Bryan smile.gif

Link to comment
Share on other sites

Ok, After several days, lots of caffene, 1 migrane, and learning a whole lot of new stuff the following poped out:

http://ivanxxxx.com/menu_mulitrun_update_20030915.zip

 

This contains update to the menu and multirun chooks. They will now run vbscripts. biggrin.gif If you set multirun as your start up chook (which it was created for) you can now run a vbscript at start up. biggrin.gif

 

This is for version 9.1. V8.1.1 and 9.0 don't have vbscript frown.gif so they won't work.

 

I need a few people familiar with the menu and multirun chooks (or if you're brave wink.gif ) to test this out first and bang it around.

 

Usage is simple if your familiar these chooks. Where before you would use [filename]* for chooks you can now use [filename]< for vbscripts. If you're not familiar there are some short install instruction files for each.

Example:

getpoint<

Will run the getpoint.vbs script.

 

Other consideration the filename must be in the Vb folder and don't make the filename longer than 8 character. This is especially important for the menu chook since the text needs to be readable. You may have to rename a few files.

 

jagourley,

Don't worry, it was a challenge and I like challenges. biggrin.gif And yes it was harder than it should have been. This is mostly due to vbscript being a very new feature and CNC Software is still getting all the bells and whistles in place. I suspect if an updated SDK for chooks comes out it'll have the appropiate functions and I'll be able replace a whole lot of code with one line. smile.gif

 

Mick G.,

Thanks once again. cheers.gif You pointed me down a whole new path with some of my code. I think I'll be able to do a few things with chooks I thought would be impossible.

 

Bryan smile.gif

Link to comment
Share on other sites

Nope I didn't ignore Heath. I couldn't bring a hasp home this weekend. Even if I did, I realized I only have 9.0 at home (we're mainly a 8.1.1 shop so there's never been a need to upgrade to 9.1) so I only could work on some backend code on saturday morning. Vbscript wasn't introduced until 9.1. I Finished up menu and multirun this afternoon when I finaly had access to 9.1 and a hasp.

 

 

Bryan smile.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...