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:

Recommended Posts

OK Guys and Gals,

 

I have a prototype part that has 7 different operations. I programmed it a few months ago using a proven post. That particular version of my post did not use VB scripts. Now we are producing a large quantity, so I need to post it for all machines. The multi-post VB script that I am currently using won't work on Operation 1, but will work on the other operations. I have 5 different VB's and in this 1 program the VB's won't even run. Not only that, when I try to produce a set-up sheet using mill.set, the set-up sheet will come up but MasterCam closes itself. Hope this makes some kind of sense. I cannot see anything obvious about this operation that causes these problems. Have any of you encountered this type of problem? All input is greatly appreciated! smile.gif

Link to comment
Share on other sites

yes that works. Plus Mick has helped me with some create folder VB's that work while I have this program up. the only diffrence I can fell is the create folder doesn't have this line

 

 

' -- Check for drawing

If IsDrawing Then

 

Could it be something about the drawing?

Link to comment
Share on other sites

The IsDrawing() function determines if you have a valid MC9 open. The MC9 is considered valid if it contains at least one entity (line, arc or point). If IsDrawing() returns False, then the script packs it in and calls it a day.

 

code:

' ////////////////////

' Sub Declaration

' ////////////////////

Sub Main()

 

'On Error Resume Next

 

' -- Check for drawing

If IsDrawing Then ' <- if this fails, the nothing else in the script is executed

 

 

Dim companyname

Dim Program

 

' and so on...

So another test on that file could be this:

 

code:

Call Main()

 

Sub Main()

If (IsDrawing) Then

ShowString "Hello Mastercam VBS World!"

End If

End Sub

 

Function IsDrawing()

Dim bRet

 

 

bRet = StartDBSearch(mc_alive, -1)

IsDrawing = bRet

End Function

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