NX11+VS2013

 #include <NXOpen/Section.hxx>
#include <NXOpen/SectionCollection.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/CoordinateSystem.hxx>
#include <NXOpen/CoordinateSystemCollection.hxx>
#include <NXOpen/CartesianCoordinateSystem.hxx>
#include <NXOpen/NXMatrix.hxx>
#include <NXOpen/NXMatrixCollection.hxx>
#include <NXOpen/Xform.hxx>
#include <NXOpen/XformCollection.hxx>
#include <NXOpen/Scalar.hxx>
#include <NXOpen/ScalarCollection.hxx>
#include <NXOpen/CylindricalCoordinateSystem.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/NXMessageBox.hxx> using namespace NXOpen;
using namespace std; NXOpen::Session *theSession = NXOpen::Session::GetSession();
NXOpen::Part *workPart(theSession->Parts()->Work());
NXOpen::Part *displayPart(theSession->Parts()->Display()); //创建一个新的笛卡尔坐标系(TRUE和FALSE,如果坐标系是临时的用TRUE,它将不会显示,也不会保存在部件中)
Point3d WcsOrigin1(100.0, 100.0, 100.0);//原点
Matrix3x3 WcsMatrix1 (, , , , , , , , );//矩阵
NXOpen::CartesianCoordinateSystem* WcsNew1 = workPart->CoordinateSystems()->CreateCoordinateSystem(WcsOrigin1, WcsMatrix1, FALSE); //创建一个新的笛卡尔坐标系
Point3d WcsOrigin2(200.0, 200.0, 200.0);//原点
Vector3d xDirection2(1.0, 0.0, 0.0);//向量
Vector3d yDirection2(0.0, 1.0, 0.0);
NXOpen::CartesianCoordinateSystem* WcsNew2 = workPart->CoordinateSystems()->CreateCoordinateSystem(WcsOrigin2, xDirection2, yDirection2); //创建一个新的笛卡尔坐标系(TRUE和FALSE,如果坐标系是临时的用TRUE,它将不会显示,也不会保存在部件中)
Point3d WcsOrigin3(300.0, 300.0, 300.0);//原点
Matrix3x3 WcsMatrix3(, , , , , , , , );//矩阵
NXOpen::NXMatrix* Matrix3 = workPart->NXMatrices()->Create(WcsMatrix3);//创建一个新的矩阵
NXOpen::CartesianCoordinateSystem* WcsNew3 = workPart->CoordinateSystems()->CreateCoordinateSystem(WcsOrigin3, Matrix3, FALSE); //创建一个新的笛卡尔坐标系
Point3d WcsOrigin4(400.0, 400.0, 400.0);//原点
Vector3d xDirection4(1.0, 0.0, 0.0);//向量
Vector3d yDirection4(0.0, 1.0, 0.0);
double Scale = ;
NXOpen::Xform* xform = workPart->Xforms()->CreateXform(WcsOrigin4, xDirection4, yDirection4, SmartObject::UpdateOptionWithinModeling, Scale);
NXOpen::CartesianCoordinateSystem* WcsNew4 = workPart->CoordinateSystems()->CreateCoordinateSystem(xform, SmartObject::UpdateOptionWithinModeling);
WcsNew4->SetVisibility(SmartObject::VisibilityOptionVisible);//设置显示坐标系 //创建一个新的圆柱坐标系
Point3d WcsOrigin5(500.0, 500.0, 500.0);//原点
Vector3d xDirection5(1.0, 0.0, 0.0);//向量
Vector3d yDirection5(0.0, 1.0, 0.0);
NXOpen::CylindricalCoordinateSystem* WcsNew5 = workPart->CoordinateSystems()->CreateCylindricalCoordinateSystem(WcsOrigin5, xDirection5, yDirection5); //创建一个新的圆柱坐标系(TRUE和FALSE,如果坐标系是临时的用TRUE,它将不会显示,也不会保存在部件中)
Point3d WcsOrigin6(600.0, 600.0, 600.0);//原点
Matrix3x3 WcsMatrix6(, , , , , , , , );//矩阵
NXOpen::NXMatrix* Matrix6 = workPart->NXMatrices()->Create(WcsMatrix6);//创建一个新的矩阵
NXOpen::CylindricalCoordinateSystem* WcsNew6 = workPart->CoordinateSystems()->CreateCylindricalCoordinateSystem(WcsOrigin6, Matrix6, FALSE); //创建一个新的圆柱坐标系
Point3d WcsOrigin7(700.0, 700.0, 700.0);//原点
Vector3d xDirection7(1.0, 0.0, 0.0);//向量
Vector3d yDirection7(0.0, 1.0, 0.0);
double Scale7 = ;
NXOpen::Xform* xform7 = workPart->Xforms()->CreateXform(WcsOrigin7, xDirection7, yDirection7, SmartObject::UpdateOptionWithinModeling, Scale7);
NXOpen::CylindricalCoordinateSystem* WcsNew7 = workPart->CoordinateSystems()->CreateCylindricalCoordinateSystem(xform7, SmartObject::UpdateOptionWithinModeling);
WcsNew7->SetVisibility(SmartObject::VisibilityOptionVisible);//设置显示坐标系 //迭代器遍历所有坐标系
vector<tag_t> AllCoordVector;//定义vector
NXOpen::CoordinateSystem* AllCoord;//定义类型
NXOpen::CoordinateSystemCollection::iterator Ite;//定义迭代器
for (Ite = workPart->CoordinateSystems()->begin(); Ite != workPart->CoordinateSystems()->end(); ++Ite)
{
AllCoord = (*Ite);
AllCoordVector.push_back(AllCoord->Tag());//获得坐标系的tag
} char msg[];
sprintf_s(msg, "坐标系数量为:%d", AllCoordVector.size());
UI::GetUI()->NXMessageBox()->Show("标题", NXMessageBox::DialogTypeWarning, msg); Caesar卢尚宇
2019年8月31日

NX二次开发-NXOpen::CoordinateSystemCollection Class Reference的更多相关文章

  1. NX二次开发-NXOpen::WCS Class Reference

    NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...

  2. NX二次开发-NXOpen::Drawings::DrawingSheet Class Reference

    NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...

  3. NX二次开发-NXOPEN自动切换到工程图模块

    UFUN的API里是没有切换到工程图的函数的,NXOPEN里是有方法可以用的.不过应该是不支持NX9以下的版本. NX9的不能录制出来,在UI类里有方法 NX9+VS2012 #include < ...

  4. NX二次开发-NXOpen获取边的端点NXOpen::Edge::GetVertices

    NX9+VS2012 #include <NXOpen/Features_BlockFeatureBuilder.hxx> #include <NXOpen/Features_Fea ...

  5. NX二次开发-NXOpen中Point3d类型转换成point类型

    NX9+VS2012 #include <NXOpen/NXObject.hxx> #include <NXOpen/Part.hxx> #include <NXOpen ...

  6. NX二次开发-NXOPEN设置工程图表格注释字体workPart->Fonts()->AddFont("chinesef_fs", NXOpen::FontCollection::TypeNx);

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  7. NX二次开发-NXOPEN获取所有工程图和所有视图DrawingSheet,DrawingSheetCollection,DraftingView

    NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...

  8. NX二次开发-NXOPEN导出STEP Step214Creator *step214Creator1;

    没有什么可以看的,NXOPEN直接录制一下导出STEP就可以了.录制出来自己挑需要的代码拿过来改一下. NX9+VS2012 #include <NXOpen/Part.hxx> #inc ...

  9. NX二次开发-NXOPEN工程图导出CAD图纸DxfdwgCreator *dxfdwgCreator1;

    没有什么可以看的,NXOPEN直接录制一下导出CAD就可以了.录制出来自己挑需要的代码拿过来改一下. NX9+VS2012 #include <NXOpen/Part.hxx> #incl ...

随机推荐

  1. 20150127 学军集训 day1

    day1 就直接考试... 和说好的不一样啊 第一题看都没怎么看就pass了,构造的题我一向没什么把握.然后瞟到第三题有30分可做,虽然要写的代码很大...反正我是写习惯了..期间纠结了一会还写了一个 ...

  2. kvm无人值守安装centos6

    nginx配置 server { listen default_server; server_name _; root /home/iso; # Load configuration files fo ...

  3. (18)C++ string和标准模板库

    一.stringl类 1.string构造函数 string a1("abc");//初始化字符串 cout<<a1<<endl;//abc , '#'); ...

  4. 前端之间的url 传值

    转自:https://www.cnblogs.com/candy-Yao/p/8858166.html

  5. Springboot+mybatis+dbcp+mysql简单集成

    1.添加依赖 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>m ...

  6. 程序性能优化之APK大小优化(六)上

    阿里P7移动互联网架构师进阶视频(每日更新中)免费学习请点击:https://space.bilibili.com/474380680 本篇文章将继续从APK瘦身来介绍APK大小优化:文章主要内容从理 ...

  7. webservice的使用-axis1-02

    1.webservice传递javabean 自定义javabean必须是可序列化的 如果javabean中有内部类必须是静态的,因为只有静态的类才可以序列化 如果javabean中用到了其他的jav ...

  8. Linux 2.6.x fs/pipe.c local kernel root(kit?) exploit (x86)

    /****************************************************************************** * .:: Impel Down ::. ...

  9. log4j 和 log4j2 在springboot中的性能对比

    文章链接: https://pengcheng.site/2019/11/17/log4j-he-log4j2-zai-springboot-zhong-de-xing-neng-dui-bi/ 前言 ...

  10. springboot整合netty,多种启动netty的方式,展现bean得多种启动方法

    首先讲解下,spring中初始化加载问题: 很多时候,我们自己写的线程池,还有bean对象,还有其他的服务类,都可以通过,相关注解进行交给spring去管理,那么我们如何让nettyserver初始化 ...