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:

TNunes

Verified Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by TNunes

  1. Hello,

     

    In my CHook project, when i use child classes of TlToolMill (TlToolEndmill/TlToolReamer) i have some compilation error:

    >main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall TlToolEndmill::~TlToolEndmill(void)" (??1TlToolEndmill@@UAE@XZ)

    1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall TlToolEndmill::TlToolEndmill(void)" (??0TlToolEndmill@@QAE@XZ)

     

    I'm just declaring a TlToolEndmill variable:

    TlToolEndmill endmTool;

     

    I dont have problem when i use the TlToolMill class.

     

    Which library had to be referenced in my project?

    I've referenced all the .lib that i could find in the sdk/debug directory with no effect:

    mastercam.lib

    mccore.lib

    UICtrls.lib

    MCMachineDef.lib

    MCMill.lib

    MCCE.lib

    MCControl.lib

    MCGeomSld.lib

    MCIk.lib

    MCKernel.lib

    MCLathe.lib

    McMatss.lib

    MCMSurf.lib

    MCMultiax.lib

    MCPost.lib

    MCPrvVerFile.lib

    MCRouter.lib

    MCRtClasses.lib

    MCUI5Ax.lib

    MCVerify.lib

    MCWire.lib

     

    Did i miss something?

     

    Thanks for your help.

  2. Hello,

     

    I have to develop an interface between MasterCAM and our Tool Database System.

    So i need to transfert Tool and Holder descriptions from our software to MasterCam.

     

    By using the NetHook API i've seen that the tool creation is easy (EndMillFlatTool, etc...) but i can't find how to manage the Tool Holder:

    -the default holder parameters ( Holder Length and diameter) displayed in the "Define Tool" window

    -the holder stored in a holder library

     

    is it possible to do that with the NetHook API or do i have to use the CHook API?

     

    Thanks for your help.

     

    PS: I'm using the X5 MU1 version.

  3. Hi,

     

    I need to build an user interface with the list of the solids.

    So i would like to know, how to get the name of all the solids which are present in a MasterCam Project.

     

    I don't know if the NetHook permit this (i don't think) or if i need to call a CHook.

    But i don't know where i should search, if somebody can't help me !

     

    Thank You,

    Best Regards

  4. Thanks Roger,

     

    In fact i would like to get the infos in the struct "group_pg3"

    which is in "op_group_info",

    which is in "op_group",

     

    And in the MCCore.dll i found the function :

    op_group* TpGrpList::GroupByName(char *Name)

    With the EntryPoint =

    "?GroupByName@TpGrpList@@QAEPAU_op_group@@PAD@Z".

     

    So i try that in my C# code :

    code:

    [DllImport("MCCore.dll", EntryPoint ="?GroupByName@TpGrpList@@QAEPAU_op_group@@PAD@Z")]

    private extern static IntPtr GroupByName(ref string Name);

    I'M NOT SURE OF THE PARAMATER(ref string Name) AND THE RETURN(IntPtr) //////////////

    code:

    private int GetStockInfo(string NameMachine)

    {

    IntPtr iIntPtr = IntPtr.Zero;

    try

    {

    MessageBox.Show(NameMachine, "NameMachine"); //for DEBUG

    iIntPtr = GroupByName(ref NameMachine);

    MessageBox.Show(NameMachine, "NameMachine"); //for DEBUG

    MessageBox.Show(iIntPtr.ToString(),"IntPtr"); //for DEBUG

    ...

    ...

    }

    catch (Exception e)

    {

    (...)

    }

    finally

    {

    //clean up memory

    if (iIntPtr != IntPtr.Zero)

    Marshal.FreeHGlobal(iIntPtr);

    }

    }

    But finally i get the three messages box :

    DMU_50_EVOLUTION //It's my Machine : OK

    DMU_50_EVOLUTION //It's my Machine : OK

    0 //Null Pointer (i don't understand)

     

    Can you please give more informations about my problems ?

    Does the EntryPoint change with the version of the dll ?

    And to get the infos in group_pg3 with the "Pointer" ?

    do i must define the structure like this :

    code:

    [structLayout(LayoutKind.Sequential)]

    public struct _op_group

    {

    public int grp_idn;

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_GROUP_NAME + 1)]

    public char[] name;

    public int parent_grp_idn;

    (...)

    public op_group_info ogi;

    }

    AND

    code:

            

    public struct op_group_info

    {

    (...)

    [MarshalAs(UnmanagedType.Struct)]

    public group_pg3 pg3;

    [MarshalAs(UnmanagedType.Struct)]

    public group_pg4 pg4;

    } ;

    AND ETC... ?

     

    Thanks for your answers!

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