Skip to main content
14-Alexandrite
Mar 6, 2017 8:21 AM UTC
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 ?

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

FV_01
FV_01Answer
Mar 7, 2017 1:57 PM UTC

Here is a snippet from Toolkit User Guide:

proview-user-guide.png

5 replies

FV_01
Mar 6, 2017 3:24 PM UTC

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.

Translate
14-Alexandrite
Mar 7, 2017 4:24 AM UTC

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

Translate
FV_01
FV_0117-PeridotAnswer
Mar 7, 2017 1:57 PM UTC

Here is a snippet from Toolkit User Guide:

proview-user-guide.png

Translate