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:

Stock to leave


Recommended Posts

Hi

I made this for you.

http://ai-sols.sytes.net/download/nethook_test2.zip

 

I dont have enough knowledge of VB/VBScript,

so I coded a assembly in C#.

 

VB code imports my c# assembly

code:

 

 

Imports System

Imports System.Windows.Forms

Imports Mastercam

Imports MCHook

 

 

Public Class NETHookVB

Inherits CMCNETApp

 

 

Public Overrides Function Run _

(ByVal param As Integer) As MC_RETURN

Dim op_idn As ULong

op_idn = 1

MessageBox.Show("op_get_stk_remain: " & MCFunc.op_get_stk_remain(op_idn).ToString)

Return MC_RETURN.MC_NOERROR

End Function

 

End Class

 


op_idn is Operation's id number.

and MCFunc.op_get_stk_remain(op_idn) fucntion will return stk_remain(Stock to leave) value.

 

HTH wink.gif

Link to comment
Share on other sites

Hi MasterShake, thanks for Your help, it works fine.

But there is also a Z-Stock to leave, maybe you can help me again?

I don't no how much work it is for you but I need some more infos:

Cycle Time: Feed and Rapid

MAX and MIN Z

 

Thank You

Ekke

Link to comment
Share on other sites

http://ai-sols.sytes.net/download/nethook_test3.zip

 

MCHook.dll is using a code mentioned in this thread.

http://www.emastercam.com/ubb/ultimatebb.p...c;f=13;t=000327

 

 

I dont have time to check min/max value of nci,

and these values are from operation struct.

 

code:

Imports System

Imports System.Windows.Forms

Imports Mastercam

Imports MCHook

 

 

Public Class NETHookVB

Inherits CMCNETApp

 

 

Public Overrides Function Run _

(ByVal param As Integer) As MC_RETURN

Dim op_idn As ULong

op_idn = 1

MessageBox.Show("op_get_stk_remain: " & MCFunc.op_get_stk_remain(op_idn).ToString)

MessageBox.Show("op_get_stock_t_l: " & MCFunc.op_get_stock_t_l(op_idn).ToString)

MessageBox.Show("op_get_top_stock: " & MCFunc.op_get_top_stock(op_idn).ToString)

MessageBox.Show("op_get_depth: " & MCFunc.op_get_depth(op_idn).ToString)

Return MC_RETURN.MC_NOERROR

End Function

 

End Class

And I also checked GetNCIMinZ(), it seems that GetNCIMinZ() returns Minimum Z depth value from whole nci data in the current database.( just a guess)

 

to get "Cycle Time", you have to read nci and calculate the time.

Link to comment
Share on other sites

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