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. 2019ccpc秦皇岛/Gym102361 D - Decimal 签到

    题意: 给定n,判断1/n是否在十进制下无限循环 题解:判断n的是否包含除2,5以外的因数即可 #include<iostream> #include<cstdio> #inc ...

  2. PostgreSQL角色和权限

      PostgreSQL是通过角色来管理数据库访问权限的,我们可以将一个角色看成是一个数据库用户,或者一组数据库用户.角色可以拥有数据库对象,如表.索引,也可以把这些对象上的权限赋予其它角色,以控制哪 ...

  3. Celery 'Getting Started' not able to retrieve results; always pending

    参考 根据Celery的官方文档,当使用windows 10 64-bit, Python 2.7,Erlang 64-bit binary, RabbitMQ server and celery r ...

  4. 泛微weaver_oa filebrowser.jsp 任意目录遍历

    url//document/imp/filebrowser.jsp?dir=/etc/

  5. python学习笔记:操作Excle

    import xlwt #写excel import xlrd #读excel import xlutils #修改excel 一.写操作 1.写Excel import xlwt #写excel,导 ...

  6. Android组件内核之Fragment管理与内核(二)

    阿里P7Android高级架构进阶视频免费学习请点击:https://space.bilibili.com/474380680本篇文章将先从以下三个内容来介绍Fragment管理与内核: [Fragm ...

  7. 高级UI晋升之自定义View实战(五)

    更多Android高级架构进阶视频学习请点击:https://space.bilibili.com/474380680本篇文章将从自定义View利器Canvas和Paint来进行详解 一.Canvas ...

  8. python 根据字典的键值进行排序

    1.利用key排序 d = {'d1':2, 'd2':4, 'd4':1,'d3':3,} for k in sorted(d): print(k,d[k]) d1 2d2 4d3 3d4 1 2. ...

  9. SQL中to_char方法的应用

    1.取得当前日期是本月的第几周 SQL> select to_char(sysdate,'YYYYMMDD W HH24:MI:SS') from dual; ----------------- ...

  10. tushare下载安装教程与版本更新步骤

    使用前提 安装Python 安装pandas:pip install pandas 安装lxml:pip install lxml 下载安装 方式1:pip install tushare,如果安装网 ...