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:

Kaoru Naruse

Verified Members
  • Posts

    32
  • Joined

  • Last visited

Kaoru Naruse's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Pete, I am sorry that a response is overdue. I tried 2nd argument in delete_ent() to TRUE. So, rotate_silent() is successful. Thankyou! -------------------- Naruse Kaoru
  2. I tried Investigation. rotate_silent() is successful when this function was used. rebuild_graphics() (I can't become clear whether this is the right way. ) code: DB_LIST_ENT_PTR ptr; DB_LIST_ENT_PTR e_ptr; ent entity; ulong ent_mask; MC_BOOL succf; MC_BOOL tp_ref_warn = FALSE;ent_mask = P_ID | A_ID | L_ID | SPLINE_ID | SOLID_ID; //////////////////////////////////////// // Delete entity of other than SOLID ptr = db_start; while( TRUE ){ get_ent( &ptr, &e_ptr, &entity, ALIVE_BIT, ent_mask, &succf ); if( succf == FALSE ){ break; } if( entity.id != SOLID_ID ){ delete_ent( e_ptr, FALSE, FALSE, FALSE, &tp_ref_warn, FALSE ); } } //////////////////////////////////////// // Why will be successful? Rebuild_graphics(); //////////////////////////////////////// // Rotate solid entity // But, rotate_silent() will be failure. ent_mask = SOLID_ID; ptr = db_start; get_ent( &ptr, &e_ptr, &entity, ALIVE_BIT, get_mask, &succf ); rotate_silent( &(e_ptr), TRUE, FALSE, RotPoint, Rot, RotViewNo, &succf );
  3. Hi, I am looking for the way of the "X_Form Rotate" in C-Hook(Mastercam X). If you know, please teach me. Reference: I want to perform these... 1.Delete entity of other than SOLID. 2.Rotate solid entity. I coding these. But, rotate_silent() will be failure. Is a mistake in somewhere? code: DB_LIST_ENT_PTR ptr; DB_LIST_ENT_PTR e_ptr; ent entity; ulong ent_mask; MC_BOOL succf; MC_BOOL tp_ref_warn = FALSE; ent_mask = P_ID | A_ID | L_ID | SPLINE_ID | SOLID_ID; //////////////////////////////////////// // Delete entity of other than SOLID ptr = db_start; while( TRUE ){ get_ent( &ptr, &e_ptr, &entity, ALIVE_BIT, ent_mask, &succf ); if( succf == FALSE ){ break; } if( entity.id != SOLID_ID ){ delete_ent( e_ptr, FALSE, FALSE, FALSE, &tp_ref_warn, FALSE ); } } //////////////////////////////////////// // Rotate solid entity // But, rotate_silent() will be failure. ent_mask = SOLID_ID; ptr = db_start; get_ent( &ptr, &e_ptr, &entity, ALIVE_BIT, get_mask, &succf ); rotate_silent( &(e_ptr), TRUE, FALSE, RotPoint, Rot, RotViewNo, &succf ); ----------------------------- Naruse Kaoru
  4. MasterShake, Mastercam exit was successful. Another code was added after the code which you taught. It has ended, after ending C-Hook immediately after 'post_FT_command'. Very thanks for your useful information. -------------------- Kaoru Naruse
  5. Very thanks MasterShake, But....Uuuum Your code was pasted on my program. and run C-Hook on the X. but not exit X. Possibly...Does it have the influence by setting...?? -------------------- Kaoru Naruse
  6. Hello MasterShake, Thanks for your advice. But, it did not work by those way. For example... code: extern "C" __declspec(dllexport) int m_main (int not_used){ post_FT_command( "Mastercam", "OnFileExit" ); keybd_event( VK_ESCAPE, 0, 0, 0 ); } This way is canceled to "OnFileExit". Therefore, Mastercam is not Exit. And exit(0) ExitProcess(0) PostQuitMessage(0) etc... Mastercam is exit, but an error dialog is displayed. 'The application you were runnning has encountered a problem and needs to close. We are sorry for the inconvenience.' Terminating parents Mastercam from C-Hook is impossible?? -------------------- Kaoru Narause
  7. Hi all, Is there any way of exit Mastercam in C-Hook? It cannot do, even if I am going to perform it. code: extern "C" __declspec(dllexport) int m_main (int not_used) { post_FT_command( "Mastercam", "OnFileExit" ); #ifndef VK_Y #define VK_Y 0x59 #endif keybd_event( VK_Y, 0, 0, 0 ); } Of course, it ends, after processing some. It seems that Mastercam cannot be exited when C-Hook is active. Please advise me if you know, about the way. -------------------- Kaoru Naruse
  8. Hi Zerren, Thanks for important info for me. "Rotate a entity" and "Clear a color" were completed by this way. code: // view_n = ViewNo of rotate a entity. // rpt = A rotational center point. // ra = Rotation angle. short current_cview = constr_view_n; constr_view_n = view_n; // ent_mask = A_ID | L_ID etc get_ent( &ptr, &found_ptr, &entity, ALIVE_BIT, ent_mask, &succf ); rotate_silent( &(entity.eptr), TRUE, FALSE, rpt, ra, view_n, &succf ); constr_view_n = current_cview; sel_bit_turn_off( &entity, RESULT_BIT ); rewrite_ent( &entity ); Thank you, -------------------- Kaoru Naruse
  9. Verry sorry MasterShake and all, Investigation was insufficient. I try on the way. -------------------- Kaoru Naruse
  10. Hello, I want to clear the color of the entity changed by rotate. But, the way cannot imagine to me. I think that this function should be used. post_FT_command( "Mastercam", "ClearColors" ); But, a color is not cleared... Is there any other way?( In X C-Hook ) -------------------- Kaoru Naruse
  11. Hello, The bug may be contained in the rotate_silent()... In the X C-Hook. quote: DllImpExp void rotate_silent ( DB_LIST_ENT_PTR * eptr, MC_BOOL init_xf, MC_BOOL copy, p_3d rpt, real ra, short view_n, MC_BOOL * succf ) It does not work, even if it specifies a view number as 'short view_n' of this function. If you know about usage of this function, please teach of me. quote: [sAMPLE CODE] // Premise : One solid is drawn on MastercamX. get_ent( &ptr, &e_ptr, &entity, ALIVE_BIT, get_mask, &succf ); view_n = 2; rotate_silent( &entity.eptr, TRUE, FALSE, rpt, ra, view_n, &succf ); // This function will be rotated in TC-Plane View without rotating in 'view_n'. -------------------- Kaoru Naruse
  12. It doesn't down or down... I am confused... Incidentally, Please teach me about... The function which deletes "Machine group" and "Toolpath group". I tried list_grp_free() and delete_group_and_subs() etc.. But, it did not work. -------------------- Kaoru Naruse
  13. Hi, I found the bug(?) when I investigating about Toolpath. quote: DllImpExp void toolpath_init ( MC_BOOL ops, MC_BOOL tls, MC_BOOL job, MC_BOOL silent, MC_BOOL * succf ) MastercamX will be downed if I use this function. Could someone use this function? -------------------- Kaoru Naruse
  14. Sorry, It was found on another thread. http://www.emastercam.com/ubb/ultimatebb.p...t=000227#000000 -------------------- Kaoru Naruse
  15. Hello, I'm useing X C-hook, and VisualC++.NET2003. Please teach me about this way if you know, How to create/setting a default machine group. I think that there is a function for creating, and tried search. But the function is not found... -------------------- Kaoru Naruse

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