Skip to main content
14-Alexandrite
March 6, 2017
Solved

I can set model view name to drawing view with ProDrawingViewOrientationFromNameSet but there is no Get API for same. Is there workaround to get it ?

  • March 6, 2017
  • 1 reply
  • 3459 views

can set model view name to drawing view with ProDrawingViewOrientationFromNameSet but there is not Get API for same.

Is there workaround to get it ?

Following code sets model view name

  //Get current drawing
  ProDrawing model;
  result = ProMdlCurrentGet((ProMdl*)&model);
  if(result != PRO_TK_NO_ERROR)
  {
   ProEngineerEnd();
   return false;
  }

  ProMdlName name;
  result =  ProMdlNameGet(model, name);

  ProMdldata data;
  result = ProMdlDataGet(model, &data);


  ProView view;
  result = ProDrawingViewInit(model, 1, &view);

  ProName name1;
  result=ProDrawingViewNameGet(model, view, name1);

  ProMatrix metrix;
  result = ProDrawingViewTransformGet(model, view, PRO_B_TRUE, metrix);
  if(result==PRO_TK_NO_ERROR)
  {
   result = ProDrawingViewOrientationFromNameSet(model, view, L"ABC", L"Isometric", 0.0, 0.0);
  }

  result = ProDrawingViewRegenerate(model, view);

  ProDrawingCurrentSheetSet(model, 1);
  int iWin;
  ProWindowCurrentGet(&iWin);
  ProDrawingtreeRefresh(model,iWin);

  //Window Refit
  ProWindowRefit(iWin);

But how to get Model View name

Best answer by FV_01

Here is a snippet from Toolkit User Guide:

proview-user-guide.png

1 reply

March 6, 2017

Hello all,

Suresh,

One of possible workarounds:

get drawing view model with ProDrawingViewSolidGet,

get named views from ProSolid with ProViewNamesGet,

loop through array of view names,

for each view - use ProViewNameToView and ProViewMatrixGet to get model view matrix,

get rid of shift and scale, normalize matrix and compare it to the drawing view matrix.

HIH.

Feliks.

14-Alexandrite
March 7, 2017

I am able to that but facing issue in comparing model view matrix with drawing view matrix.

Can you please suggets me how on "get rid of shift and scale, normalize model view matrix"

Thanks,

Suresh

FV_0117-PeridotAnswer
March 7, 2017

Here is a snippet from Toolkit User Guide:

proview-user-guide.png