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:

Roger Martin from CNC Software

CNC Software
  • Posts

    2,870
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Roger Martin from CNC Software

  1. There appears to be a defect with the Mirror member method in the Geometry class.
    The Geometry.Mirror and Geometry.Rotate methods can take a lot of time if you have hundreds of entities.
    A faster way (that also works!) is to use the XForm methods in GeometryManipulationManager -> 

    /// <summary> Mirror all geometry. </summary>
    ///
    /// <returns> Success / Failure status. </returns>
    private bool MirrorAll()
      {
      // The GeometryManipulationManager XForm methods work on the 'selected' geometry.
      Mastercam.IO.SelectionManager.SelectAllGeometry();
    
      var line = new Line3D(new Point3D(0, 0, 0), new Point3D(1, 0, 0));
      var view = SearchManager.GetSystemView(Mastercam.IO.Types.GraphicsViewType.Top);
      var result = Mastercam.GeometryUtility.GeometryManipulationManager.MirrorGeometry(line, view, false);
    
      if (result)
        {
        // If we need to manipulate these geometry items further (as NET-Hook Geometry objects),
        // we can retrieve the Result of the last XForm operation ->
        var xFormResultGeometry = Mastercam.Support.SearchManager.GetResultGeometry();
        // Do something with this geometry?
        }
    
      return result;
      }
    
  2. 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.
  3.  

    BTW why this is still a c-hook and not a command of standart install.

    I use it all the time.

    Move it to the standart set and you will see how people would like to use it.

    Same for  the Arcmultiedit.dll c-hook .

     

    Pts2Arcs
    ArcMultiEdit
    PrmDef
    VHelix
    ZSpiral
     
    Are all scheduled to be included in the std. install in the next major release.
    • Like 1
  4.  

     

    When I tried to install this nothing appears to be happening. I right clicked and selected to unblock and to run as admin but when I double click the .exe the hour glass shows up and then  goes away and nothing else appears to happen.

     

    I get the same - HSMAdvisor_For_MasterCAM_X9_v1.162_NET4.0.exe does nothing.

    The EXE file  was "blocked' after downloading, but I took care of that.

    I'm running McAfee and I tried turning it off and then the running the EXE (also as Admin) and the result was the same ->

    A couple seconds of spinning icon and then nothing...

  5. Required software tools for building a C-Hook for use with Mastercam X9

    1> The Mastercam C-Hook SDK for X9

    2> Microsoft Visual Studio 2013 (you can use the Community edition of 2013) <= NOT the new 2015 edition.

    You'll need to make some changes to the Project settings for new include paths and .lib files referenced in the C-Hook SDK.

    And maybe other changes, depending on what this C-Hook does and if any of the functions it used have changed within Mastercam.

    • Like 1
  6. Did you try tool_manager?

     

    tp_tool tool = *toolPtr; // "Convert" from a new style tool (TlToolMillPtr)  data to old-style.
    tool_manager(&tool, mode, &d_ptr, &succf);
     
     
    And if that's not what you want, try this...
    #include "TlToolFunctions_CH.h"
    CreateNewToolWizard (FALSE, toolPtr);  // toolPtr here is a TlToolMillPtr
  7. Select the machine, define the stock, select the VPlane and TPlane, select a chain(s), define a tool, define an operation, attach the tool to operation, generate the G-Code.

     

    “define the stock” => Cannot do this programmatically.

     

    (Other highlighted items) =>

    I always suggest not doing this.

    This is much more involved to do and you end up with a “hard-coded” add-on.

    Every time you need to tweak something, you end up having to rebuild the add-on.

    If you reference an operation from an OPERATIONS library file, all you need to do 98% of the time is adjust the parameters and/or tool in that “template” operation.

    What you want to do is import the operation (which has the tool) and then have the add-on gather up the chains, programmatically (if possible) or by prompting the user to select them.

  8. The "Unblock" option (if the file is blocked) would be found by right-clicking on the DLL file, selecting Properties tab and in the lower-right you'd see an "Unblock" button.

     

    *Note that this unblock issue is is only for NET-Hooks, not C-Hooks.

     This .NET issue is not new and not really a Mastercam issue, but it will be addressed in the next major release.

     Google: "File Zone Identifier" for more information if you're interested.

     

    If you're getting "Invalid user application", a couple thing to look at ->

    * The DLL was not built for the version of Mastercam you're trying to run it on.

    * The DLL is dependent on other (usually DLL) files that could not be found and/or loaded.

  9. On the Misc. Values page of the operation parameters...
    I assume that the 'Automatically set to post values when posting' option is not checked.
    I would check the NCI data see see what's in there.
    When you post your operation, select the create and edit the NCI file.
    Search for the line that contains only "1011".
    The line below is your (10) Misc. Real values.
    Is there really a value other then "0" for the MR1 ?

  10. Nevio,

     

    It appears that your vb.net (NET-Hook) is calling a function via a call into (C++) C-Hook DLL

    Dim rv As Integer = CHookInterop.RunTurnProfile(0)

    That C-Hook would need to be recompiled for X9, using the C-Hook SDK for X9.

     

    *** Ignore the above, if I had read all of your post, I should have noticed that the "C-Hook" being referenced is the  SilhouetteBoundary.DLL, which of course part of Mastercam.

     

    I will look into this more today, and I'll get back to you...

     

     

    -------- * Update * ------

     

    Nevio,

     

    Try this...

     

    Change this ->

     

    Public Const CHookDLL As String = "SilhouetteBoundary.DLL"

     

    To this ->

     

    Public Const CHookDLL As String = "MCCAD.DLL"

  11. I am running Windows 7 with all Microsoft Updates and no I've never heard of any update causing a NET-Hook issue.

     

    Zip2Go.DLL is a NET-Hook and FindOverlap.DLL is a C-Hook.

    Meaning the .NET Framework is involved with one and not the other, so...

    it would appear that something has gotten messed up in that area on these systems.

     

    Trying running the CD_Compare.DLL (in \chooks\CD_Compare folder) and if that does not  run, that could confirm this assumption.

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