NX二次开发-NXOpen::WCS Class Reference
- NX11+VS2013
- #include <NXOpen/Part.hxx>
- #include <NXOpen/PartCollection.hxx>
- #include <NXOpen/Session.hxx>
- #include <NXOpen/WCS.hxx>
- #include <NXOpen/CartesianCoordinateSystem.hxx>
- #include <NXOpen/CoordinateSystem.hxx>
- #include <NXOpen/CoordinateSystemCollection.hxx>
- using namespace NXOpen;
- NXOpen::Session *theSession = NXOpen::Session::GetSession();
- NXOpen::Part *workPart(theSession->Parts()->Work());
- NXOpen::Part *displayPart(theSession->Parts()->Display());
- //获取WCS相关信息
- NXOpen::CartesianCoordinateSystem* WcsData = workPart->WCS()->CoordinateSystem();
- //获得WCS的向量方向
- NXOpen::Vector3d xDirection;
- NXOpen::Vector3d yDirection;
- WcsData->GetDirections(&xDirection, &yDirection);
- //获得WCS的原点坐标
- Point3d WcsOrigin = workPart->WCS()->Origin();
- //围绕指定的轴旋转WCS
- double Angle = 45.0;
- workPart->WCS()->Rotate(NXOpen::WCS::AxisXAxis, Angle);
- //在工作部件中创建一个新的笛卡尔坐标系,即使WCS属于显示部件
- NXOpen::CartesianCoordinateSystem* WcsNew = workPart->WCS()->Save();
- //将WCS的坐标系更改为一个新的坐标系
- //返回值是旧的坐标系。将WCS移动到新的坐标系位置后,将显示旧坐标系。
- NXOpen::Point3d origin1 = { 150.0, 0.0, 0.0 };
- NXOpen::Vector3d xDirection1 = { 1.0, 0.0, 0.0 };
- NXOpen::Vector3d yDirection1 = { 0.0, 1.0, 0.0 };
- NXOpen::CartesianCoordinateSystem *newCs = workPart->CoordinateSystems()->CreateCoordinateSystem(origin1, xDirection1, yDirection1);
- NXOpen::CartesianCoordinateSystem* WcsOld = workPart->WCS()->SetCoordinateSystem(newCs);
- //在新的坐标系中创建一个WCS
- //返回值是WCS的旧坐标系
- NXOpen::Point3d origin2 = { 150.0, 0.0, 0.0 };
- NXOpen::Vector3d xDirection2 = { 1.0, 0.0, 0.0 };
- NXOpen::Vector3d yDirection2 = { 0.0, 1.0, 0.0 };
- NXOpen::CartesianCoordinateSystem *newCs1 = workPart->CoordinateSystems()->CreateCoordinateSystem(origin2, xDirection2, yDirection2);
- NXOpen::CartesianCoordinateSystem* WcsOld1 = workPart->WCS()->SetCoordinateSystemCartesianAtCsys(newCs1);
- //设置WCS原点
- Point3d WcsOri = { 100.0, 100.0, 100.0 };
- workPart->WCS()->SetOrigin(WcsOri);
- //设置WCS的原点和方向矩阵
- Point3d WcsOri1 = { 100.0, 100.0, 100.0 };
- Matrix3x3 matrix = { , , , , , , , , };
- workPart->WCS()->SetOriginAndMatrix(WcsOri1, matrix);
- //设置WCS的可见性
- workPart->WCS()->SetVisibility(false);
- //得到WCS的tag
- tag_t WcsTag = workPart->WCS()->Tag();
- //获得WCS的可见性
- bool WcsVis = workPart->WCS()->Visibility();
- 2019年8月17日
Caesar卢尚宇
NX二次开发-NXOpen::WCS Class Reference的更多相关文章
- NX二次开发-NXOpen::CoordinateSystemCollection Class Reference
NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...
- NX二次开发-获取WCS坐标系的原点坐标和矩阵标识
函数:UF_CSYS_ask_csys_info() 函数说明:获取工作坐标系对象的标识符. 用法: #include <uf.h> #include <uf_csys.h> ...
- NX二次开发-获取WCS标识
函数:UF_CSYS_ask_wcs() 函数说明:获取工作坐标系对象的标识. 用法: 1 #include <uf.h> 2 #include <uf_csys.h> 3 e ...
- NX二次开发-NXOpen::Drawings::DrawingSheet Class Reference
NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...
- NX二次开发-NXOPEN自动切换到工程图模块
UFUN的API里是没有切换到工程图的函数的,NXOPEN里是有方法可以用的.不过应该是不支持NX9以下的版本. NX9的不能录制出来,在UI类里有方法 NX9+VS2012 #include < ...
- NX二次开发-NXOpen获取边的端点NXOpen::Edge::GetVertices
NX9+VS2012 #include <NXOpen/Features_BlockFeatureBuilder.hxx> #include <NXOpen/Features_Fea ...
- NX二次开发-获取WCS标识UF_CSYS_ask_wcs
NX9+VS2012 #include <uf.h> #include <uf_csys.h> UF_initialize(); //获取WCS标识 tag_t WcsId = ...
- NX二次开发-设置WCS位置UF_CSYS_set_wcs
NX9+VS2012 UF_initialize(); //输入X向量Y向量输出一个3*3矩阵 ] = {0.0, 0.0, 1.0}; ] = {0.0, 1.0, 0.0}; ]; UF_MTX3 ...
- NX二次开发-设置WCS显示UF_CSYS_set_wcs_display
NX9+VS2012 #include <uf.h> #include <uf_csys.h> UF_initialize(); //设置WCS显示 //1显示WCS, 0不显 ...
随机推荐
- mysql查找字段空、不为空的方法总结
1.不为空 Select * From table_name Where id<>'' Select * From table_name Where id!='' 2.为空 Select ...
- Ansible自动化部署K8S集群
Ansible自动化部署K8S集群 1.1 Ansible介绍 Ansible是一种IT自动化工具.它可以配置系统,部署软件以及协调更高级的IT任务,例如持续部署,滚动更新.Ansible适用于管理企 ...
- leetcode-160周赛-5240-串联字符串的最大长度
题目描述: 自己的提交:O(2**n∗n∗m),m 为字符串长度 class Solution: def maxLength(self, arr: List[str]) -> int: from ...
- ArrayList,LinkedList,Vector集合的认识
最近在温习Java集合部分,花了三天时间读完了ArrayList与LinkedList以及Vector部分的源码.之前都是停留在简单使用ArrayList的API,读完源码看完不少文章后总算是对原理方 ...
- JCF——List
ArrayList LinkedList Vector
- 出现Warning: date(): It is not safe to rely on the system's timezone settings的解决办法
在没有配置,尤其是新安装的PHP中使用date函数时,会报这个错误: Warning: date(): It is not safe to rely on the system's timezone ...
- fiddler抓包工具详解
转自:http://www.cnblogs.com/yyhh/p/5140852.html Fiddler 抓包工具总结 阅读目录 1. Fiddler 抓包简介 1). 字段说明 2). Sta ...
- error C3861: “L”: 找不到标识符
提示错误的语句:::CLSIDFromProgID(L("Shell.Application"), &clsid); 解决办法: 出现上面的错误是因为语法错误了,去掉字符串 ...
- SQL生成 C# Model
本文转自: https://www.cnblogs.com/jhli/p/11552105.html declare @TableName sysname = 'T_FakeOrderList' de ...
- cd 命令行进入目标文件夹
当我在默认路径中使用cd命令时,如果我要进入D:\mytext 文件夹,那么直接使用cd D:\mytext 是不行的 正确的使用是先使用d:进入D盘,然后再进入mytext文件夹