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:

Rekd™

Member
  • Posts

    4,477
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Rekd™

  1. I'm running the mmouse and mcutils chooks. I was MWzooming and slid my cursor over the color select menu and level select menu while zooming and it started flipping thru colors and levels! eek.gif

     

    Very cool.

     

    It will cycle thru all colors/levels and start over. Only thing is, on levels, you can take it to level zero. I was able to create geo in that level, and when I went into the level dialog, it showed level zero in the little box, but not in the list. It also did not show the added geometry. The text for the level shows as "all off". When I click OK, it want's me to enter a level between 1 and 255.

     

    Very interesting. Guess I should create a new file instead of playing around with a good program eh?

  2. geeterhead, lol.

     

    No, Jimmy, I couldn't possibly do that, as many of my programs have in excess of 150 toolpaths. It'd take half the trees on my block to print out one setup sheet. (To put things into perspective, I have six 70+ year old oaks in my yard eek.gif )

  3. Here you go. Some mods will be required.

     

    code:

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

    '//

    '// Author: Matt Finley [email protected]

    '// Date: 06/05/2004 09:16 AM

    '// File Name: SavedNCI.vbs

    '//

    '// Description: Changes all NCI destinations to match file name, posts that

    '// file with the specified post, then changes the NCIs

    '// back to originals. Some modification is required.

    '//

    '//

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

     

     

    Const DEF_POST2 = "HAAS VF3 POST 4 AXIS.PST" ' Post to use (Change this)

     

    Dim MC9Path, NCIPath ' Paths used

    Dim aryDest() ' holds NCI Paths until finished posting

    Dim i ' counter

     

    Call ClearPromptLines()

    Call WriteString("Storing original NCI destinations on " & GetOperationCount("") & " operations...")

     

    NCIPath = GetCurrentFileName() ' Set NCI to current MC9 file name

    NCIPath = Left(NCIPath, Len(ncipath)-4) & "-Combined.MC9" ' Append "-Combined" to end of new NC name (Change this)

     

    ' -- Grab all the NCI destinations and store them

    ReDim aryDest(GetOperationCount("")) ' Set array's size to number of ops

    For i = 1 To GetOperationCount("") ' Cycle thru ops

    arydest(i) = GetNciNameFromOperationID("", i) ' Store orignial NCI path

    Call SetNciNameFromOperationID(i, NCIPath) ' Set new NCI path

    Next

     

    Call WriteString(" Done.")

     

    Call Main() ' Post it

     

    ' --Return NCI destinations to the originals

    Call WriteString("Restoring original NCI Destinations...")

    For i = 1 To GetOperationCount("") ' Cycle thru ops

    Call SetNciNameFromOperationID(i, arydest(i)) ' Retrieve original NCI path from array and apply

    Next

    Call ClearPromptLines()

     

    Sub Main()

    Dim strPath

    Dim strCurrentPost

    MC9Path = GetPathFromExtension("MC9")

    If Not IsDrawing Then

    ShowString "Gots to have a file... "

    Exit Sub

    End If

    ' -- Store current post

    strCurrentPost = GetPostName

    ' -- Post to MC9's path

    strPath = mc9path

    If strPath = Null Then Exit Sub

    Call SetPostName(DEF_POST2)

    Call RunPostAll(strPath, 0)

    ' -- Revert back to original post

    Call SetPostName(strCurrentPost)

     

     

    End Sub

     

    Function IsDrawing()

    Dim Ret

    Ret = StartDBSearch(mc_alive, -1)

    IsDrawing = Ret

    End Function

    Softmill, this is what I use for a tool stop via a drill cycle.

     

    code:

    pmisc2          #Canned Misc #2 Cycle (User Option)

    #Use this postblock to customize drilling cycles 8 - 19

    #Canned Cycle for Tool Stop

    pdrlcommonb

    if drillcyc = 8, pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,

    prdrlout, dwell, *feed, strcantext, e

    else, n, pfxout, pfyout, e

    n, pfzout, pfcout, e

    n, "M00", e

    n, *max_depth, e

    pcom_movea

    That code gives me this

     

    code:

    N2 M01

    ( OPERATION: 1 DRILL )

    N3 ( OP 1 )

    N4 ( LOCATE Y )

    N5 T1 M06(T1: 1/4 CHAMFER MILL)

    (MAX-DEPTH | Z-1.)

    N6(OP ID: 1)

    N7 G00 G90 G54 X0. Y2.5 A0.

    N8 G43 H1 Z1.

    / N9

    N10 X0. Y2.5

    N11 Z-1.

    N12 M00

    N13 Z1.

    N14 G80

    N15 G90

    N16 M01

  4. Found it. There's a file called MPBIN.hlp that explains how to use it.

     

    Mpbin.dll - Post Protection Utility

     

     

    Setup : Put mpbin.dll, mpbin.txt and mpbin.hlp in your c-hooks directory. Mpbin access code is needed to run option 3 below (post access code). Only dealers are provided an access code from CNC Software, Inc. on request. Put the access code, mpbin.acc, into your main Mastercam

    directory.

     

    Description : This post protection utility supplies users/dealers with ways to protect *.PST files. This is done by removing a block of text from the .PST file and converting into a binary file, *.PSB, so it cannot be read.

     

     

    Files:

    .PSM - the original post file

    .PST - the post file with a block of text removed

    .PSB - the binary file that contains the text missing from the original post file

    .ACC - the post access code for a specific post and SIM number

     

    The binary file can be made in three ways, each method has advantages and disadvantages:

     

    1) to run with a specific SIM,

    2) to run with any SIM,

    3) to run with a post access code.

     

    1) Post binary file for a specific SIM. This method takes the .PSM file and removes a block of text to make the .pst file. Then, using the block of removed text and the user SIM number the .PSB file is made. The resulting .PST/.PSB files will only run on the computer with the specified SIM.

     

     

    mpbin.dll

    postname.psm --------------> postname.pst

    SIM number postname.psb (for specific SIM)

     

    The main advantage of this method is that the post binary file will only run on a computer with the right SIM number. So, users cannot read or modify the post and cannot share the post with other users. The disadvantages are a separate post binary file must be made for every SIM that the post will be used with and every time the post is changed new binary files must be made for every SIM that the post will be used with.

     

     

    2) Post binary file for any SIM. This method takes the .PSM file and removes a block of text to make the .PST file. Then, using the block of removed text and "0" for the SIM number the .PSB file is made. The resulting .PST/.PSB files will run on any computer as long as the SIM is present.

     

    mpbin.dll

    postname.psm --------------> postname.pst

    postname.psb (for any SIM)

     

    The main advantages of this method are that only one post binary file needs to be made and it will run regardless of the SIM number. It is not nesessary to know the customer SIM number to make the .PSB file. The disadvantage is that even though the users can't read or modify the post the users can share the post with each other. This method enables the check boxes to select the SIM type, Educational, Industrial, Dealer or Control, which the post may run on. Select the type(s) in the dialog box. (Note: SIM type is only active for MP 7.36 and later)

     

     

    3) Post binary file that requires a post access code. This method takes the .PSM file and removes a block of text to make the .PST file. Then, using the block of removed text and the name of the post the .PSB file is made. Once the .PSB file is made a post access code is needed. The name of the post and the user SIM number are used to make the post access code. The resulting .PST/.PSB files will only run if a valid post access code and valid SIM are present.

     

    mpbin.dll

     

    postname.psm --------------> postname.pst

    postname.psb (for post access code)

     

    mpbin.dll

    postname --------------> postname.acc

    SIM number

     

    The main advantage of this method is that only one post binary file needs to be made an it will run with many SIMS, as long a valid post access code and valid SIM are present. This could be very useful if a post will be used with many SIMS because, when the post is changed only one new binary file needs to be made and it will work for all SIMS with the post access code present. The disadvantages are that a separate post access code is required for every SIM that the post will be used with and any dealer can give a user a post access code for any post that requires one, even if the dealer does not have the original post.

     

     

    How to use MPBIN :

    1. Backing up your post file is not necessary but it is recommended.

     

    2. The first thing to do is rename the original file with extension .PSM.

     

    3. Put the word 'startbin' or 'STARTBIN' on the line before the first line of text to be removed and the word 'endbin' or 'ENDBIN' on the line after the last line of text to be removed. If these words appear in comments (after #) then they will be ignored.

     

    4. Run the c-hook MPBIN.DLL. Choose the protection method you want to use and enter the required information. Select OK to produce the files.

     

     

    5. At this point you are ready to ship the .PST and .PSB files, and .ACC file if there is one, to the customer.

     

    6. Save the original post file in case the customer needs a new SIM so a new .PSB file or .ACC file can be made using the new SIM number.

     

    Notes :

    1. Only one block of text can be moved to the .PSB file.

     

    2. Any amount of text from one line to the entire post processor file can be moved to the .PSB file. The amount of text removed is up to you but it is to your advantage to leave enough text for the user to make minor modifications without your help.

     

     

    3. After the block of text is removed the line with the word 'startbin' will remain in the .PST file to mark the location for MP to begin reading from the .PSB file.

     

    4. After the block of text is removed the line with the word 'endbin' is no longer needed and is thrown out (does not appear in the .PST or .PSB).

     

    5. If you run a post with extension .PSM then the words 'startbin' and 'endbin' will be ignored.

     

    6. The .ACC file, if there is one, must be in the same directory as the .PST and .PSB files.

     

     

    7. When using method 3, the post access code and .PSB are dependent on the name of the post file. If you rename the .PST/.PSB/.ACC files they will not run properly. In this case you will have to remake the files using the new name.

     

    8. Selecting "Always allow post to run on dealer SIM" overrides all other setting for dealer SIMs and allows the post to run.

  5. quote:

    and not have to be changing .nci destinations

    every time I post.

    In a nutshell, you can do it. (You'll have to format and declare variables etc yourself, I'm short on time. biggrin.gif )

     

    To change NCI paths, use something like this. (It stores the current NCI paths in an array so you can restore them later, but it must all be done in the same script at the same time unless you write the NCI's to a file instead of an array.)

     

    code:

    NCIPath = GetCurrentFileName() ' Set NCI to current MC9 file name

    NCIPath = Left(NCIPath, Len(ncipath)-4) & "-Combined.MC9" ' Append "-Combined" to end of new NC name

    ' -- Grab all the NCI destinations and store them

    ReDim aryDest(GetOperationCount("")) ' Set array's size to number of ops

    For i = 1 To GetOperationCount("") ' Cycle thru ops

    arydest(i) = GetNciNameFromOperationID("", i) ' Store orignial NCI path

    Call SetNciNameFromOperationID(i, NCIPath) ' Set new NCI path

    Next

    Now post normally using your favorite method (from the same script). You can use multiple posts like this;

     

    code:

    Const DEF_POST1  = "HAAS VF3 POST PRESTAGE 4 AXIS.PST"

    Const DEF_POST2 = "Mill2.set"

    Dim MC9Path

    Dim strPath

    Dim strCurrentPost

     

    MC9Path = GetPathFromExtension("mc9")

     

    If Not IsDrawing Then

    ShowString "We need a drawing"

    Exit Sub

    End If

     

    ' -- Store current post

    strCurrentPost = GetPostName

     

    ' -- Prompt user for a folder to export NC

    strPath = BrowseForFolder("Choose Folder for NC Ouput", mc9path)

     

    If strPath = Null Then Exit Sub

     

    Call SetPostName(DEF_POST1)

     

    Call RunPostAll(strPath, False)

     

    ' -- Prompt user for a folder to export HTML

    strPath = BrowseForFolder("Choose Folder for Setup Sheet Ouput", mc9path)

     

    If strPath = Null Then Exit Sub

     

    Call SetPostName(DEF_POST2)

     

    Call RunPostAll(strPath, False)

     

    ' -- Revert back to original post

    Call SetPostName(strCurrentPost)

     

    End Sub

    Then you'll want to restore the original NCI's, so use something like this.

     

    code:

    ' --Return NCI destinations to the originals

    Call WriteString("Restoring original NCI Destinations...")

    For i = 1 To GetOperationCount("") ' Cycle thru ops

    Call SetNciNameFromOperationID(i, arydest(i)) ' Retrieve original NCI path from array and apply

    Next

    Again, I'm short on time. Run thru this and if you have ?'s let me know.

  6. quote:

    The WCS in which you created the stock must be active to verify correctly.

    Doesn't have to be. If you regen an op in that WCS, it will leave the stock for verify in that WCS even if you're in a different WCS. The trick is to regen the operation in the original WCS just before you verify. smile.gif

  7. If the problem occurs when you verify from a WCS that's OTHER than the WCS you set your stock boundries with, then there's a trick:

     

    Select ANY operation from the original WCS (that you created the stock with,) and regen it. Then without changing WCS', select all ops and verify. This will 'trick' the stock setup into behaving the way you'd expect.

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