AnsweredAssumed Answered

unable to retrieve Rotation Matrix in solidworks.

Question asked by Yoyo Yoyo on Feb 3, 2020

Hi,

i want to retrieve Rotation matrix and Translation Matrix using .net api in solidworks 2020. It says "Unable to get instance of an object". Below is the code snippet.

 

ISldWorks^ swApp = gcnew

ModelDoc2^  swModel = swApp->IActiveDoc2;
ModelDocExtension^ swModelDocExt = swModel->

View3D^ capture = swModelDocExt->Capture3DView();
capture->Activate(true);
 //Get Rotation Matrix
  MathTransform^ rot = capture->Rotation;
  System::Object^ _rot = rot->ArrayData;
  array<Double>^ _arr = dynamic_cast<array<Double>^>(_rot);

 

Regards

 

 

Outcomes