/*====================================================================*\ FILE : UgAsmcompTransfGet.c PURPOSE : ProTk User Guide : assembly example HISTORY.. DATE BUILD AUTHOR MODIFICATIONS 04-Dec-97 H-02-02 PGautreau $$1 Create 19-Feb-01 J-01-28 Senthil $$2 The ProAsmcomppathInit() is Removed. \*====================================================================*/ /*====================================================================*\ Function : UserAsmcompTransfGet() Purpose : Find the transformation matrix of the specified component \*====================================================================*/ int UserAsmcompTransfGet() { ProError status; ProMdl model; int nb_sel, i; ProMatrix matrix; ProAsmcomppath comp_path; ProIdTable comp_id_table; ProSelection *sel_list,selection; ProModelitem sel_obj; ProFeature feature; ProFeattype ftype; FILE *fp_out=NULL; ProName w_name, wfile_name; ProCharName name; status = ProSelect ("prt_or_asm",1,NULL,NULL,NULL,NULL, &sel_list,&nb_sel); ERROR_CHECK("UserAsmcompTransfGet","ProSelect",status); if (status == PRO_TK_NO_ERROR) { if (nb_sel > 0) { status = ProSelectionModelitemGet (sel_list[0],&sel_obj); ERROR_CHECK("UserAsmcompTransfGet","ProSelectionModelitemGet", status); status = ProSelectionHighlight (sel_list[0],PRO_COLOR_ERROR); ERROR_CHECK("UserAsmcompTransfGet","ProSelectionHighlight", status); status = ProSelectionAsmcomppathGet(sel_list[0],&comp_path); ERROR_CHECK("UserAsmcompTransfGet","ProSelectionAsmcomppathGet", status); if (status != PRO_TK_NO_ERROR) return (PRO_TK_GENERAL_ERROR); status = ProAsmcomppathTrfGet (&comp_path,PRO_B_TRUE,matrix); ERROR_CHECK("UserAsmcompTransfGet","ProAsmcomppathTrfGet", status); if (status != PRO_TK_NO_ERROR) return (PRO_TK_GENERAL_ERROR); status = ProAsmcomppathMdlGet(&comp_path,&model); ERROR_CHECK("UserAsmcompTransfGet","ProAsmcomppathMdlGet", status); if (status != PRO_TK_NO_ERROR) return (PRO_TK_GENERAL_ERROR); ProMdlNameGet(model,w_name); ProWstringToString(name,w_name); fp_out = fopen("rptfile.txt", "w"); fprintf(fp_out, " ------ Component Location ------ \n\n"); fprintf(fp_out, "Component name : %s\n\n",name); fprintf(fp_out, "Matrix :\n\n"); for (i=0 ; i<4 ; i++) fprintf(fp_out, "%f\t%f\t%f\t%f\n", matrix[i][0],matrix[i][1], matrix[i][2],matrix[i][3]); fclose(fp_out); ProStringToWstring(w_name,"rptfile.txt"); status = ProInfoWindowDisplay (w_name,NULL,NULL); ERROR_CHECK("UserAsmcompTransfGet","ProInfoWindowDisplay", status); if (status != PRO_TK_NO_ERROR) return (-1); } } return (PRO_TK_NO_ERROR); }