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. PHP filter_list() 函数

    定义和用法 filter_list() 函数返回包含所有得到支持的过滤器的一个数组. 语法 filter_list() 提示和注释 注释:该函数的结果不是过滤器 ID,而是过滤器名称.请使用 filt ...

  2. DMA实验总结

    一.RCC设置 没什么好写的之前USART的基本一样 /************************************************************************ ...

  3. <自动化测试>之<Selenium API 的用法1>

    今天,简单,举例说一下在用python+selenium中元素定位的主要方法,第一部分是单个元素的操作,第二部分是一类元素的操作,实际操作中注意区分 #!/usr/bin/env python # - ...

  4. implements Serializable有什么作用

    转自 http://blog.csdn.net/dinghqalex/article/details/46009911

  5. echarts(4.0版本)

    1.echarts 开发文档 :https://echarts.baidu.com/echarts2/doc/doc.html  或  https://echarts.baidu.com/option ...

  6. BZOJ5484: [Usaco2018 Dec]Sort It Out

    5484: [Usaco2018 Dec]Sort It Out https://www.lydsy.com/JudgeOnline/problem.php?id=5484 Sol. 考虑没有在被喊叫 ...

  7. 【已转移】【Java架构:基础技术】一篇文章搞掂:Java 8

    本文篇幅较长,建议合理利用右上角目录进行查看(如果没有目录请刷新). 一.Java的历史与演变 目的:为完全了解Java,需要理解Java的诞生原因.成型动力以及他继承的思想. 计算机语言的创新与发展 ...

  8. php 字符串 定界符 json_last_error()

    字符串的3种赋值 1:单引号 $str = '111111111111 '; 2:双引号 $str =" 11111111111 "; 3:定界符 $str = <<& ...

  9. mysql 自动加上编号

    SELECT (@i:=@i+1) i,user_id,user_name FROM dt_user_all_orders, (SELECT @i:=0) as i

  10. 大数据学习笔记之Hadoop(一):Hadoop入门

    文章目录 大数据概论 一.大数据概念 二.大数据的特点 三.大数据能干啥? 四.大数据发展前景 五.企业数据部的业务流程分析 六.企业数据部的一般组织结构 Hadoop(入门) 一 从Hadoop框架 ...