zoukankan      html  css  js  c++  java
  • NXOpen 获取WCS相关数据

    #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);

    怡宁塑胶模具设计
  • 相关阅读:
    JS连接数据库“实例”
    sql数据字典
    硬件防火墙的配置
    xxx
    rhs属性文件删除法
    思科pix防火墙配置实例大全
    SilverLight中的画刷小结
    数据库表间的连接总结
    导入Excel到Sql Server 2005 (转)
    关于Silverlight页面跳转的总结
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14538045.html
Copyright © 2011-2022 走看看