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:

JSergeant81

Verified Members
  • Posts

    10
  • Joined

  • Last visited

About JSergeant81

  • Birthday 09/01/1980

Profile Information

  • Gender
    Male

Uncategorized

  • Location
    Maine

JSergeant81's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Good Morning All, Is there a way to tie a shortcut to run a VBS file as a button on the toolbars? I know you can with C-Hooks but I cannot seem to find a way to do VBS Files. Thanks & Happy Holidays! James
  2. Hi there, That is a great idea! I didn't even think about renaming them! I did a search and in VBS it is "Fso.MoveFile oldfile, newfile" but I get an error that says... " Microsoft VBScript runtime error Variable is undefined: 'Fso' IActiveScriptSite::OnScriptError() Line: " Do I need to declare or reference something before I use FSO lines in mastercam scripts? Here is the modified code if you'd like to see it... '============================================================================ '{--- Loop and Post for Each Machine Using Data Gathered ---} '============================================================================ Dim PostLoopCounter For PostLoopCounter = 0 to PostCount - 1 '============================================================================ '{--- Change File Names File Names To Match Machine Post ---} '============================================================================ ' For LoopCounter = 0 To NoOfOps ' If GetOperationSelectedFromID(vbNullString, LoopCounter) Then ' Call SetNciNameFromOperationID(LoopCounter, (MachName(PostLoopCounter) & DefinedNCFile)) ' End If ' Next '============================================================================ '{--- Post Program ---} '============================================================================ Call SetPostName(vbNullString) Call SetPostName(Posts(PostLoopCounter)) Call RunPostAll(TapeLoc, False) Fso.MoveFile (TapeLoc & DefinedNCFile), (TapeLoc & (MachName(PostLoopCounter) & DefinedNCFile)) ShowString ("Number of Ops : " & NoOfOps & VBCRLF & _ "Number of Posts : " & PostCount & VBCRLF & _ "Selected : " & NoOfSelectedOps & "/" & NoOfOps & VBCRLF & _ "Defined File : " & DefinedNCFile & VBCRLF & _ "Posted File : " & (MachName(PostLoopCounter) & DefinedNCFile) & VBCRLF & _ "Using Post : " & Posts(PostLoopCounter) & VBCRLF & _ "Post To : " & TapeLoc) Next
  3. Good Morning, When I do the highlighted step below "Change File Names File Names To Match Machine Post" it seems to work fine when I end it after. It renames all of the File Names appropriately when I right click on an op, Edit Selected Ops, Change NC File Name it appears to be changed as it should be. However, it will not post as if it has unselected all of the operations. When I comment this re-naming bit out it posts just fine but over writes my posts. Is there something I need to do to apply these changes after the "Call SetNciNameFromOperationID" line? Do I need to re-select the operations again somehow after? Thanks! James '=============================================================== '{--- Loop and Post for Each Machine Using Data Gathered ---} '=============================================================== Dim PostLoopCounter For PostLoopCounter = 0 to PostCount - 1 '=============================================================== '{--- Change File Names File Names To Match Machine Post ---} '=============================================================== ' For LoopCounter = 0 To NoOfOps ' If GetOperationSelectedFromID(vbNullString, LoopCounter) Then ' Call SetNciNameFromOperationID(LoopCounter, (MachName(PostLoopCounter) & DefinedNCFile)) ' End If ' Next '=============================================================== '{--- Post Program ---} '=============================================================== Call SetPostName(vbNullString) Call SetPostName(Posts(PostLoopCounter)) Call RunPostAll(TapeLoc, False) ShowString ("Number of Ops : " & NoOfOps & VBCRLF & _ "Number of Posts : " & PostCount & VBCRLF & _ "Selected : " & NoOfSelectedOps & "/" & NoOfOps & VBCRLF & _ "Defined File : " & DefinedNCFile & VBCRLF & _ "Posted File : " & (MachName(PostLoopCounter) & DefinedNCFile) & VBCRLF & _ "Using Post : " & Posts(PostLoopCounter) & VBCRLF & _ "Post To : " & TapeLoc) Next
  4. Ok, last time I bother you guys today I promise! I've re-written so I fully understand the example above and it works like a charm until I rename the NCI. When I do the highlighted step below "Change File Names File Names To Match Machine Post" it seems to work fine when I end it after. It renames all of the File Names appropriately when I right click on an op, Edit Selected Ops, Change NC File Name it appears to be changed as it should be. However, it will not post as if it has unselected all of the operations. When I comment this re-naming bit out it posts just fine but over writes my posts like I was having troubles with before. Is there something I need to do to apply these changes after the "Call SetNciNameFromOperationID" line? Or do I need to re-select the operations again somehow after? '============================================================================ '{--- Loop and Post for Each Machine Using Data Gathered ---} '============================================================================ Dim PostLoopCounter For PostLoopCounter = 0 to PostCount - 1 '============================================================================ '{--- Change File Names File Names To Match Machine Post ---} '============================================================================ ' For LoopCounter = 0 To NoOfOps ' If GetOperationSelectedFromID(vbNullString, LoopCounter) Then ' Call SetNciNameFromOperationID(LoopCounter, (MachName(PostLoopCounter) & DefinedNCFile)) ' End If ' Next '============================================================================ '{--- Post Program ---} '============================================================================ Call SetPostName(vbNullString) Call SetPostName(Posts(PostLoopCounter)) Call RunPostAll(TapeLoc, False) ShowString ("Number of Ops : " & NoOfOps & VBCRLF & _ "Number of Posts : " & PostCount & VBCRLF & _ "Selected : " & NoOfSelectedOps & "/" & NoOfOps & VBCRLF & _ "Defined File : " & DefinedNCFile & VBCRLF & _ "Posted File : " & (MachName(PostLoopCounter) & DefinedNCFile) & VBCRLF & _ "Using Post : " & Posts(PostLoopCounter) & VBCRLF & _ "Post To : " & TapeLoc) Next
  5. Ok, thank you again for the pointers. I am re-writing it now to see if I can get it to do that!
  6. Good Afternoon! So, I've been playing around with this for a few hours now and have gotten it to pretty much do what I want. I have run into a hangup though where it is overwriting the files. When I use the example above they do post two different files but overwrite eachother. Is there a way to change the File Name Before posting of the to-be created TAP file? Something like... Call SetTapFileName("Machine1.TAP") Call SetPostName("o:\post location\post 1's file name.pst") Call RunPostAll("\\DNC Path\\Folder Full of TAP Files\", False) Call SetTapFileName("Machine2.TAP") Call SetPostName("o:\post location\post 2's file name.pst") Call RunPostAll("\\DNC Path\\Folder Full of TAP Files\", False) And for bonus points, is there a way to auto select "No" when the Operations Manager prompts saying "Multiple tools using the same tool number were found! Generate a tool change in the NCI?" in this process as well? Thanks again guys! James
  7. Is there a way using this method to tell it the File Name that you wish to call the newly posted program?
  8. Thank you very much for the example. I will play around with it in the next couple days and see what I can get it to do! Happy Holidays! James
  9. Good Morning, I am using X9. I cannot seem to get the extensions to work in Visual Studio Pro 2015 so I have been trying in VBScript. James
  10. Good Morning All, When I make a change to a program I need to re-post it to up to 8 different machine types depending on the product line. The typical routine in this shop is to got to the Machine Definition Manager, Pick the required Post-Processor from the drop-down list, click the green check, say yes to the "Replace group machine" prompt, click Post Selected Operations, Name the files (Naming convention is the same depending on machine), and posting. Is there a good VB Script somewhere that I can pick apart and Frankenstein to make this process a little less tedious? If not, can someone point me in the direction of a good example line or two of code for picking the post processor and posting? Thanks! James

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