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

I am trying to write a startup script for X and I am having a problem.

 

Start=AskString("Create a new file? (y or n)")

 

The prompt window appears and is blank as it should be. But I have to type the info (y or n) in & run the script again. Then it will be in the drop down. How do I get the options to load when the script starts the first time?

 

Thanks

Leif

Link to comment
Share on other sites

Dim Start

Dim LatheMill

'///////////////// My Global Variables //////////

' -- Start Script

Call Main()

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

' Sub Declaration

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

Sub Main()

Start=AskString("Create a new file? (y or n)")

If Start = "y" Then

LatheMill=AskString("Lathe or Mill?")

If LatheMill = "Mill" Then

SetLevelName 10, "Finished part"

SetLevelName 20, "Raw material"

SetLevelName 30, "Fixtures"

SetLevelName 40, "Plane geometry"

End If

If LatheMill = "Lathe" Then

SetLevelName 10, "Finished part"

SetLevelName 20, "Finished slice"

SetLevelName 20, "Raw material"

SetLevelName 21, "Raw slice"

SetLevelName 20, "Raw revolve"

SetLevelName 30, "Fixtures"

SetLevelName 40, "Plane geometry"

End If

End If

If Start = "n" Then

Call RunMastercamCommand("OnFileOpen") 'Opens default MCX foulder at startup

End If

End Sub

Link to comment
Share on other sites

On a different thing. I see a possbile problem:

code:

End If

If LatheMill = "Lathe" Then

SetLevelName 10, "Finished part"

SetLevelName 20, "Finished slice"

SetLevelName 20, "Raw material"

SetLevelName 21, "Raw slice"

SetLevelName 20, "Raw revolve"

SetLevelName 30, "Fixtures"

SetLevelName 40, "Plane geometry"

End If

You are setting the levles the same on a few of these item I think this might give you problems when you do get the other problem solved.

 

HTH

Link to comment
Share on other sites

Sub Main()

Dim Start

Dim LatheMill

If askYesNo("Create a new file?") Then

LatheMill=AskString("Lathe or Mill?")

 

If instr(Ucase(LatheMill),"MILL") Then

showstring ("mill")

SetLevelName 10, "Finished part"

SetLevelName 20, "Raw material"

SetLevelName 30, "Fixtures"

SetLevelName 40, "Plane geometry"

End If

If instr(Ucase(LatheMill),"LATHE") Then

SetLevelName 10, "Finished part"

SetLevelName 20, "Finished slice"

SetLevelName 20, "Raw material"

SetLevelName 21, "Raw slice"

SetLevelName 20, "Raw revolve"

SetLevelName 30, "Fixtures"

SetLevelName 40, "Plane geometry"

End If

Else

Call RunMastercamCommand("OnFileOpen") 'Opens default MCX foulder at startup

End If

 

End Sub

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