Kaoru Naruse
Verified Members-
Posts
32 -
Joined
-
Last visited
Kaoru Naruse's Achievements
Newbie (1/14)
0
Reputation
-
way of X_Form Rotate
Kaoru Naruse replied to Kaoru Naruse's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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 -
way of X_Form Rotate
Kaoru Naruse replied to Kaoru Naruse's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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 ); -
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
-
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
-
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
-
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
-
[BUG???] rotate_silent()
Kaoru Naruse replied to Kaoru Naruse's topic in Mastercam C-Hook, NET-Hook and VBScript Development
Verry sorry MasterShake and all, Investigation was insufficient. I try on the way. -------------------- Kaoru Naruse -
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
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.