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:

HELP Importing Machine Group with vbs script


Recommended Posts

Hello,

 

I need help creating a vbs script to import  machine groups. 

 

here is what I do now:

 

click on "MACHINE TYPE" on the file menu

click on "Router"

click on "1 C:\users\...."

 

I would like to map a key to do this.

 

I often insert up to 50 Machine Groups in a single mastercam file, so it is very time consuming.

 

I would be even greater to have a message box to prompt me for the quantity of machine groups and import them automatically.

 

any help will be appreciated

 

thank you

Alexi

 

 

 

 

 

 

 

Link to comment
Share on other sites

Alexi,

 

Maybe just some confusion on my part in the wording of your request.

It sounds as if you are not really "importing", you are creating Machine Group(s) by selecting a Machine Definition - correct?

'////////////////////////////////////////////////////////////////////////////////
'//
'//        Author:   CNC Software, INnc.
'//          Date:   22/09/2015 
'//     File Name:   MillMachineGroup.vbs
'//
'//   Description:   Mastercam VB Script
'//
'//      Comments:   Creates Mill Machine Group(s)
'//
'////////////////////////////////////////////////////////////////////////////////

'///////////////// Constants /////////////////
Public Const PRODUCT_MILL   = 0
Public Const PRODUCT_LATHE  = 1
Public Const PRODUCT_WIRE   = 2
Public Const PRODUCT_DESIGN = 3
Public Const PRODUCT_ROUTER = 5

Public Const CNC_MACHINES_FOLDER = "C:\Users\Public\Documents\shared mcamx9\CNC_MACHINES\"
Public Const MACHINE = "ROUTER 5-AXIS HEAD-HEAD.RMD-9"

' -- Start Script
Call Main()                

' ////////////////////
' Sub Declaration
' ////////////////////
Sub Main()

Dim numMachines
Dim index

If askNumber("How many Machine Groups?", 1, 100, numMachines) Then
 For index = 1 To numMachines Step 1
  ChangeMachineType(PRODUCT_ROUTER)
  SetActiveMachine(CNC_MACHINES_FOLDER + MACHINE)
 Next
End If

End Sub

To be able to execute a VB Script via a toolbar icon and/or keystroke you need to "link" it using ScriptLinker ->

 

Select the Masterversion: X8 or X9
Scroll down to the Add-Ons section.
Download and install ScriptLinker.
Read the included instructions on how to "link" a VB Script.
Link to comment
Share on other sites
  • 1 month later...

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