#include <NXOpen/WCS.hxx>
#include <NXOpen/NXMatrix.hxx>
#include <NXOpen/CartesianCoordinateSystem.hxx>
#include <NXOpen/CoordinateSystem.hxx>
#include <NXOpen/CoordinateSystemCollection.hxx>
Point3d OriginalWcsOrigin ;//WCS 原点
NXOpen::Vector3d OriginalxDirection;//WCS X轴
NXOpen::Vector3d OriginalyDirection;//WCS Y轴
NXOpen::Matrix3x3 OriginalWsmtx;//WCS 矩阵
NXOpen::CartesianCoordinateSystem* OriginalWcsData = workPart->WCS()->CoordinateSystem();
//获得WCS的相关信息
OriginalWcsOrigin = workPart->WCS()->Origin();
OriginalWcsData->GetDirections(&OriginalxDirection, &OriginalyDirection);
OriginalWsmtx = workPart->WCS()->CoordinateSystem()->Orientation()->Element();
sprintf (msg, "WCS的原点:%.2f %.2f %.2f ", OriginalWcsOrigin.X , OriginalWcsOrigin.Y,OriginalWcsOrigin.Z);
theSession->ListingWindow()->WriteLine(msg);
sprintf (msg, "WCS的X轴:%.2f %.2f %.2f ", OriginalxDirection.X , OriginalxDirection.Y,OriginalxDirection.Z);
theSession->ListingWindow()->WriteLine(msg);
sprintf (msg, "WCS的Y轴:%.2f %.2f %.2f ", OriginalyDirection.X , OriginalyDirection.Y,OriginalyDirection.Z);
theSession->ListingWindow()->WriteLine(msg);
sprintf (msg, "WCS的矩阵:%.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f ",
OriginalWsmtx.Xx , OriginalWsmtx.Xy,OriginalWsmtx.Xz,
OriginalWsmtx.Yx , OriginalWsmtx.Yy,OriginalWsmtx.Yz,
OriginalWsmtx.Zx , OriginalWsmtx.Zy,OriginalWsmtx.Zz );
theSession->ListingWindow()->WriteLine(msg);