/*****************************************************************************\ FILE : UgSheetAdd.c PURPOSE : Pro/TOOLKIT User Guide Example - drawing sheets HISTORY.. DATE BUILD AUTHOR MODIFICATIONS 04-Dec-97 H-02-02 Philippe $$1 Created \*****************************************************************************/ /*-------------------------- Pro/Develop includes ---------------------------*/ #include #include /*-------------------------- Pro/Toolkit includes ---------------------------*/ #include #include #include /*-------------------------- Application includes ---------------------------*/ #include /*================================================================*\ FUNCTION : UserSheetAdd() PURPOSE : Adds a drawing sheet to the current drawing-type object \*================================================================*/ ProError UserSheetAdd () { int status; int win_id, sheet_num; ProCharLine astr; ProMdl p_draw; ProFileName WMSGFIL = {'m','s','g','_','u','g','d','w','g','.','t','x','t','\0'}; /*------------------------------------------------------------*\ Get the current model \*------------------------------------------------------------*/ status = ProMdlCurrentGet(&p_draw); ERROR_CHECK("UserSheetAdd","ProMdlCurrentGet",status); if (status != PRO_TK_NO_ERROR) return(status); /*------------------------------------------------------------*\ Add the drawing sheet to the current drawing-type object. \*------------------------------------------------------------*/ status = prodrw_add_sheet ( (Prohandle)p_draw, &sheet_num); ERROR_CHECK("UserSheetAdd","prodrw_add_sheet", (status != PRODRW_ADD_SHEET_SUCCESS)); if (status != PRODRW_ADD_SHEET_SUCCESS) return (PRO_TK_GENERAL_ERROR); /*------------------------------------------------------------*\ Print a message in the message window \*------------------------------------------------------------*/ if (status != PRODRW_ADD_SHEET_SUCCESS) { sprintf (astr, "Error %d while adding sheet", status); status = ProMessageDisplay (WMSGFIL,"USER %0s", astr); ERROR_CHECK("UserSheetAdd","ProMessageDisplay",status); return(PRO_TK_GENERAL_ERROR); } sprintf (astr, "Sheet No. %0d added to drawing.", sheet_num); status = ProMessageDisplay (WMSGFIL,"USER %0s", astr); ERROR_CHECK("UserSheetAdd","ProMessageDisplay",status); /*------------------------------------------------------------*\ Update the changes by repainting the window \*------------------------------------------------------------*/ status = ProWindowCurrentGet(&win_id); ERROR_CHECK("UserSheetAdd","ProWindowCurrentGet",status); if (status != PRO_TK_NO_ERROR) return(status); status = ProWindowRepaint (win_id); ERROR_CHECK("UserSheetAdd","ProWindowRepaint",status); return(status); }