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:

Launching MCVBS w/VBnet for X4


Recommended Posts

banghead.gifconfused.gif

We have an application written in VB.net 2005 which creates and launches a Mastercam VBScript. It worked great in X & X2 (We skipped X3) but now does not work in X4. Any idea what we are doing wrong? Here is the line of VB.net code that does not work:

 

Mastercam.GUI.RunVBScript("c:mcamxMOM.vbs")

 

If I launch the VBScript directly from X4 it works fine.

 

Thanks for help

Link to comment
Share on other sites

Randy,

 

Here's a few things to double-check before moving forward.

 

First, make sure your .[Mastercam Install Directory]Apps directory contains both the MCVBScript.dll and McDef.VBB files. These will need to be in that particular directory in order for the VBScript to run correctly. Second, check to make sure you're passing in the correct path for your script and that the file is in the correct place. The NetHook 1.0 API won't throw an error if the script path is wrong, it will just return without executing.

 

I haven't tried it with the NetHook 1.0 API yet, but I was able to successfully run a VBScript from the NetHook 2.0 API via a test app. If it's still failing after checking the things I mentioned above, we can see about trying to recreate it with a NetHook 1.0 app too.

Link to comment
Share on other sites

The .dll & .VBB files are in the correct directory (in our case it is C:mcamxapps) and the path for the VBScript is correct. This VB.net application is for model management and the VBScript adds the correct workgroups to the Mastercam file for the specific job being charged out. The VBScript is being built okay but when we try to launch it then Mastercam locks up and crashes.

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