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:

Recommended Posts

  • 2 weeks later...

Jure,

 

First off, Lathe is not specifically supported in the NetHook. That's not to say it won't work - whatever you're doing may work fine, but I wanted to start off with that disclaimer.

 

Now, regardless of the operation or the machine the chain should be reversing. Would you mind posting some of your code so we could take a look at it and maybe iron out what's going wrong? And if you could give us a few more details that could help a lot too - things like whether the operation is getting created at all, whether the chain just isn't being reversed, or whether you're running into some other sort of problem.

Link to comment
Share on other sites
  • 2 weeks later...

Mike Crivello,

 

thank you for your answer. I have already lost my patience and the topic has lost its label "urgent". tongue.gif

 

I know Lathe is not so well supported, but I am already fairly deep in .NET programming for lathe, which is important to me. So I appeal to CNC Software to improve the .NET support for lathe in the future.

 

This is the requested code for the method to make an operation:

code:

public static int MakeOperationFromName(string operationsFile, string opName, int geomLevel, int SS, bool reverseChain)

{

//Chain all on this level

ArrayList chainRefs = new ArrayList();

if (!Mastercam.Chain.ChainAll(false, false, true, geomLevel, true, chainRefs)) return 0;

else

{

COperationRef opRef;

opRef = COperationRef.ImportFromFile(operationsFile, opName);

//Does operation exist in the operations file?

if (opRef == null)

throw new Exception("RouteLevel::COperationRef.ImportFromFile(" + operationsFile + ", " + opName.ToString() + ") not found!!!");

//Predefine spindle speed in order for it to work

opRef.spindleSpeed = 0;

opRef.spindleSpeed = SS;

if (Chain.ChainManager(opRef, chainRefs, 1, 0))

{

if (reverseChain)

foreach (CChainRef cr in chainRefs)

{

if (!Chain.ReverseChain(cr))

throw new Exception("Call to RouteLevel::Chain.ReverseChain() failed on level " + geomLevel + "!!!");

}

if (!Toolpath.RegenOp(opRef))

throw new Exception("Call to RouteLevel::RegenOp() on level " + geomLevel + " failed!!!");

}

else throw new Exception("Call to RouteLevel::Chain.ChainManager() on level " + geomLevel + " failed!!!");

if (chainRefs.Count > 0)

{

if (!Mastercam.Chain.FreeChains(chainRefs))

throw new Exception("Call to RouteLevel::FreeChains() on level " + geomLevel + " failed!!!");

}

return opRef.operationID;

}

}

The operation is created, but the direction of its chain is always the same, regardless of the value of the bool reverseChain parameter.

 

Please, don't hesitate to ask for additional information, since your help means a lot to me. Thank you.

Link to comment
Share on other sites

Hi, I dont know much about nethook.

can you try this?

Chain.ChainManager(opRef, chainRefs, 4, 0);

 

because CHNMGR_REVERSE is 4

 

 

code:

/** *@defgroup chn_mgr_def Chain Manager Modes

* @{*/

#define CHNMGR_MENU 0 ///< display chain manager dialog

#define CHNMGR_ADD 1 ///< add chains to an existing operation

#define CHNMGR_DELETE 2 ///< remove chains from an existing operation

#define CHNMGR_RENAME 3 ///< change the name of chains within an operation

#define CHNMGR_REVERSE 4 ///< reverse the chains in an operation

#define CHNMGR_RECHAIN 5 ///< replace chains within an operation

#define CHNMGR_RECHAIN_ALL 6 ///< replace ALL chains within an operation

#define CHNMGR_CHG_SIDE 7 ///< flip cutter comp on chains within an operation

#define CHNMGR_CHG_AT_PT 8 ///< modify attributes at a point on chain(s)

#define CHNMGR_START_PT 9 ///< change start point of chains within an operation

#define CHNMGR_GET 10 ///< get all the chains from an operation

/** @}*/

HTH

 

OT:

I said "it seemed chook functions available in nethook2.0" in another thread.

that was incorrect..

I just saw chook functions in NETHook2_0.xml. I could not use them.

 

NETHook2_0.xml

code:

          <member name="M:uu_to_scrn(System.Double*,System.Int16*)">

 

@par Purpose:

This method converts user units (inches or mm) to screen units (pixels).

 

@param[in] pt a 2d point in user units

@param[out] scrn_pt a point in screen units

 

 

</member>

<member name="M:scrn_to_uu(System.Int16*,System.Double*)">

 

@par Purpose:

This method converts screen units (pixels) to user units (inches or mm).

 

@param[in] scrn_pt screen point in pixels

@param[out] pt point in user units

 

 

</member>

Link to comment
Share on other sites
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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