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:

SavannahG

Verified Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by SavannahG

  1. HOORAY! It works. Thanks Jeff. I spent hours digging through the sample code and never found an example addressing the tool manager using the ToolNetAPI. Your example is exactly what I needed. I just tweaked a few things for VB, and it works. Here's the VB  version, try not to sneeze!

     

       Friend Function CreateEMF(P As Integer) As TlToolEndmill
            Dim toolSystem = TlToolFunctions.GetToolSystem()
    
            ' Define a new tool
            Dim endMill = New TlToolEndmill() With {
                        .OverallDiameter = ToolDia(P),
                        .MfgToolCode = ToolMfg(P),
                        .OverallLength = oa_len(P),
                        .ShoulderDiameter = shldr_dia(P),
                        .ShoulderLength = shldr_len(P),
                        .NeckDiameter = rel_dia(P),
                        .Name = ToolCmnt(P),
                        .ToolNumber = ToolNum(P),
                        .FluteCount = ToolFlts(P),
                        .DiameterOffsetNum = ToolDiaOff(P),
                        .LengthOffsetNum = ToolLenOff(P),
                        .ShankType = shnk_type(P),
                        .TaperLength = rel_len(P)}
    
    
            Dim toolAssembly = New TlAssembly() With {.MainTool = endMill}
    
            Return If(Not toolSystem.Add(toolAssembly), Nothing, endMill)
    
        End Function

     

  2. Jeff, do you have an example of how to save the tool to the tool manager using the ToolNetApi.dll functions? I have the method for the Mastercam.database EndMillFlatTool class as follows:

        Friend Function CreateEMFlat(P As Integer) As EndMillFlatTool
            ' Define a new tool
            Dim endMill = New EndMillFlatTool(ToolDia(P), ToolRad(P), ToolNum(P), ToolLenOff(P), ToolDiaOff(P), oa_len(P), flute_len(P), shldr_len(P), ToolCmnt(P)) With {
                        .Coolant = CoolantMode.COOL_FLOOD,
                        .Flutes = ToolFlts(P),
                        .MfgToolCode = ToolMfg(P),
                        .PlungeFeed = ToolPlunge(P),
                        .RetractFeed = ToolRetract(P)}

            MessageBox.Show("Neck Relief = " & ToolRel(P))

            ' Commit the tool to the database
            Return If(Not endMill.Commit(), Nothing, endMill)

        End Function

    **************************************************************

    I've been trying to figure out how to commit the tool using the ToolNetAPI TlToolEndmill class.

        Friend Function CreateEMF(P As Integer) As TlToolEndmill

            ' Define a new tool
            Dim endMill = New TlToolEndmill() With {
                        .OverallDiameter = ToolDia(P),
                        .MfgToolCode = ToolMfg(P),
                        .OverallLength = oa_len(P),
                        .ShoulderDiameter = shldr_len(P),
                        .ShoulderLength = shldr_len(P),
                        .NeckDiameter = ToolRel(P),
                        .Name = ToolName(P)}

            Return ???

        End Function

     

     

  3. Thank you for the suggestions.

    Peter, I'm trying to define a end mill with a relief diameter, so it goes cutter diameter/length, then shoulder diameter/length, then Neck diameter/length, then Shank diameter to Overall length.

    Jeff, I'm going by the Net-Hook API reference guide online version of the NET-Hook_v3 Reference. That was what I found in the MasterCam downloads. I'll look into the ToolNetApi. It looks promising.

  4. On ‎6‎/‎28‎/‎2017 at 9:28 AM, nickbe10 said:

    I originally programmed in APT, organizing your geometry file in some sort of usable and logical order was essential. So with 999,999 levels it was a natural and easy transfer for me. Each OP starts on a number separated by 100 or 1000 depending on the size of the file. I always put a copy of the origin on the first level, say 100. Op2 would be 200. All Op1 Toolpath geometry 120 - 130, Op2 220 - 230.....you get the idea. 0 -  100 for models and setup geometry etc...things that all the ops might refer to. Then good descriptions on the level. Use Level sets sometimes, rarely use viewsheets.

    I also started with APT back in 1987. I've been programming in MasterCam since 1990 and I use exactly the same method nickbe10 describes here word for word. I tried using level sets, but I just found it to be more clutter. In the end it's really about whatever works for you. One mans organization is another mans clutter. For me Level Sets and View Sheets are just additional maintenance. That's just how my brain works.

    I like what Benk said...

    On ‎6‎/‎28‎/‎2017 at 10:05 AM, BenK said:

     But with that said, we all use it differently and that is whats great about it, options.

     

  5. I used to develop c-hooks way back in V9 and prior, and I'm getting back into it now. My question is are the advantages to using the VB Net-hook or C# Net-hooks instead of C-hooks? Or are the multiple formats just to accommodate the language someone may be already familiar with? I did notice a forum post that noted you can not access the SQL database tool libraries with Chooks, but had an example of doing it with a Net-hook. I guess the bottom line is, should I switch to VB or C# Net-hooks instead of continuing with C-hooks?

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