Solved
get left and bottom most edges from drawing view
Hi all.
In Creo toolkit how to take left and bottom most edges from the drawing view(not a model view)?
if anyone knows pls help me
Thanks
Hi all.
In Creo toolkit how to take left and bottom most edges from the drawing view(not a model view)?
if anyone knows pls help me
Thanks
1. Visit all views using ProDrawingViewVisit
2. Use ProDrawingViewSheetGet to determine the sheet number of the visited view
3. Compare positions using ProDrawingViewOutlineGet for the same sheet number
Below is sample code to get the bottom left view for recent sheets.
static int curSheet = -1;
ProError userViewVisit(ProDrawing drw,ProView view,ProError status,ProAppData data)
{
int viewSheet = -1;
status = ProDrawingViewSheetGet(drw,view,&viewSheet);
if(curSheet == viewSheet)
{
ProName viewName;
status = ProViewNameGet(*(ProView*)data,viewName);
if(status!=PRO_TK_NO_ERROR) *(ProView*)data = view;
else
{
Pro3dPnt VeiwSize_1[2],VeiwSize_2[2];
status = ProDrawingViewOutlineGet(drw,view,VeiwSize_1);
status = ProDrawingViewOutlineGet(drw,*(ProView*)data,VeiwSize_2);
if(VeiwSize_1[0][0] < VeiwSize_2[0][0] || VeiwSize_1[0][1] < VeiwSize_2[0][1])
{
*(ProView*)data = view;
}
}
}
return PRO_TK_NO_ERROR;
}
ProError userTest()
{
ProMdl drw;
ProError status = ProMdlCurrentGet(&drw);
if(status != PRO_TK_NO_ERROR) return status;
ProMdlType type;
status = ProMdlTypeGet(drw,&type);
if(type != PRO_MDL_DRAWING) return PRO_TK_BAD_CONTEXT;
status = ProDrawingCurrentSheetGet((ProDrawing)drw,&curSheet);
ProView leftBottomView = NULL;
status = ProDrawingViewVisit((ProDrawing)drw,(ProViewVisitAction)userViewVisit , NULL,&leftBottomView);
if(leftBottomView != NULL)
{
ProName viewName;
status = ProViewNameGet(leftBottomView,viewName);
ProMessageDisplay(MSGFIL,"USER %0ls",viewName);
}
return PRO_TK_NO_ERROR;
}Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.