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:
woot, I just called your VBSCript file with reraltive path(not full path).
that caused the problem.. sorry.
When you open File Dialog and select a file name to save/open, the currect directory path setting is changed.
I will fix the problem later..
or should I make a chook in c/c++?
it may fix RMB icon problem..
The wizard working is not working under Visual Studio 2005 for me..
So I use VS2003 and re-open it with VS2005 for now.
however I have to change include paths and add uicontrol.lib etc..
Hi
I think it is possible.
though I dont know the file format of .mask file.
I have made selection mask by ascii text file before, but it does not use .mask file.
code:
/**
* Get a visible, unmasked (not excluded by the level mask) entity according
* to sel_mask and ent_mask, and optionally color, level or style. If
* sel_method is 1, only sel_mask and ent_mask are used. If sel_methodis 2,
* sel_mask, ent_mask and color are used. If sel_method is 3, sel_mask,
* ent_mask and level are used. If sel_method is 4, sel_mask, ent_mask, and
* style are used.
*
* @param[in] s The selection mask
* @param[in,out] ptr The current position in the database
* @param[out] found_ptr The pointer to entity
* @param[out] entity The entity
* @param[in] sel_mask The selection mask
* @param[out] succf TRUE if entity found
*/
DllImpExp void get_ent_univ (sel_mask_type *s, DB_LIST_ENT_PTR *ptr, DB_LIST_ENT_PTR *found_ptr,
ent *entity, ushort sel_mask, MC_BOOL *succf);
MCFile.GetOperations() function seems calling MCFile.OpenMC() internally.
I have not tried following code..but it may work.
code:
MCFile.SaveMCAs(mcamName,1)' Save cuurent
MCFile.NewMC(0) ' Reset Database
MCFile.GetOperations(mcamName,array) ' Open File and Read op arraylist...
Visual Studio Tool Menu -> IL Dasm, and open nethook.dll for disassembled code.
code:
bool GetOperations(string PathName, ArrayList arrOps)
{
if (!OpenMC(PathName))
{
return false;
}
So I added MCFunc.GetOperations()function to MCHook.dll
http://ai-sols.sytes.net/download/nethook_test4.zip
[ 11-05-2006, 12:49 AM: Message edited by: MasterShake ]
hi
does your vb.nethook code have "Public Overrides Function Version"?
C:McamX2documentationNET-Hook Developer's GuideCode examplesCode examplesNETHookNotifyVBNETHookNotifyVBNETHookNotifyVB.vb
code:
Imports System.Windows.Forms
Imports Mastercam
Public Class NETHookNotifyVB
Inherits CMCNETApp
Public Overrides Function Init(ByVal param As Integer) _
As MC_RETURN
MessageBox.Show("Inside Init()")
Return MC_RETURN.MC_NOERROR
End Function
Public Overrides Function Run(ByVal param As Integer) _
As MC_RETURN
MessageBox.Show("Inside Run()")
Return MC_RETURN.MC_NOERROR
End Function
Public Overrides Function Close(ByVal param As Integer) _
As MC_RETURN
MessageBox.Show("Inside Close()")
Return MC_RETURN.MC_NOERROR
End Function
Public Overrides Function Version(ByVal param As Integer) As Integer
MessageBox.Show("Inside Version()")
Return MyBase.Version(param)
End Function
End Class
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.
hi
File Open - file type = ASCII will import points/lines/spline in a text format.
what your text looks like?
ex)
-1.641393,26.59057,0
-13.62356,30.36577,0
-33.32028,16.41393,0
-35.28995,-0.9848358,0
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
I dont know,
I tried select_ent and I can select the same point multiple times.
if you mean you want multiple point entities at once, try select_ents ().
and if what you need is to select only points, point_proc() function will also do point selection.
just a thought.
[ 10-31-2006, 10:38 AM: Message edited by: MasterShake ]
Hi Roger,
I see what you say,
I also tried AssemblyBuilder and came to the qestion "how I can embed resources??...".
and did google searchs and searchs for tutorials/articles numbers of times until I found System.CodeDom.Compiler.
I spend 2 days of a weekend for making that .anyway..
and I thought I couldn't write a code without google!
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.