/* Copyright (c) 2024 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved. */ /*-------------------------- Pro/Toolkit includes ---------------------------*/ #include <ProToolkit.h> #include <ProMdl.h> #include <ProCsys.h> #include <ProDrawing.h> /*-------------------------- Application includes ---------------------------*/ #include <TestError.h> /*================================================================*\ FUNCTION : UserSheetAdd() PURPOSE : Adds a drawing sheet to the current drawing-type object \*================================================================*/ ProError UserSheetAdd () { ProError status; int win_id, sheet_num; ProCharLine astr; ProDrawing p_draw; ProFileName WMSGFIL = {'m','s','g','_','u','g','d','w','g','.','t','x','t','\0'}; /*------------------------------------------------------------*\ Get the current model \*------------------------------------------------------------*/ status = ProMdlCurrentGet((ProMdl*)&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 = ProDrawingSheetCreate(p_draw, &sheet_num); ERROR_CHECK("UserSheetAdd","ProDrawingSheetCreate", status); if (status != PRO_TK_NO_ERROR) return (PRO_TK_GENERAL_ERROR); ProTKSprintf (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); }