Proxies, WorkAxes, Vectors and Points

Top  Previous  Next

Here is an example of getting the data about a work axis in part which has been inserted into an assembly:



       CComPtr<Line> pAxisLine = nullptr ;

       p1stHoleWorkAxisProxy->get_Line (&pAxisLine) ;

       CComPtr<Point> pRootPoint ;

       pAxisLine->get_RootPoint (&pRootPoint) ;

       CComPtr<UnitVector> pAxisDir ;

       pAxisLine->get_Direction (&pAxisDir) ;


Now you can use that axis to form a rotation matrix:


       CComPtr<Vector> pAxisVector = nullptr ;

       pTransGeom->CreateVector (pAxisDir->X,pAxisDir->Y,pAxisDir->Y,&pAxisVector) ;


       pRotMatrix->SetToRotation (gkPi,pAxisVector,pRootPoint) ;




Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)