摘要: #NX二次开发-坐标系转换 从CSYS转换到ACS; 1 void MapPointFromCsysToAcs(tag_t csys, double* point) 2 { 3 if (NULL_TAG == csys) 4 { 5 return; 6 } 7 8 double csysOrigin 阅读全文
posted @ 2020-12-14 14:36 不再低调 阅读(576) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-拆分路径为文件夹和文件名 1 void SplitFileName(std::string fullName, std::string &dirName, std::string &fileName) 2 { 3 TrimString(fullName); 4 dirName.cle 阅读全文
posted @ 2020-12-14 14:22 不再低调 阅读(327) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-获取当前dll的项目路径、获取配置文件路径 获取当前dll的项目路径; 1 string NXCommon::GetUserDir() 2 { 3 std::string dll = GetHostName(); 4 string dir, fname; 5 SplitFileNam 阅读全文
posted @ 2020-12-14 14:18 不再低调 阅读(607) 评论(2) 推荐(0) 编辑
摘要: #NX二次开发-克隆装配 克隆操作 1 string CloneAssemble(const string & fileName, const string & outputDirectory, bool isDryrun) 2 { 3 //设置操作类型 4 UF_CLONE_operation_c 阅读全文
posted @ 2020-12-14 14:05 不再低调 阅读(958) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-获取装配根节点、所有子节点、部件原型 获取装配根节点tag; 1 tag_t GetRootComponent(tag_t part) 2 { 3 if (NULL_TAG == part) 4 { 5 return NULL_TAG; 6 } 7 8 return UF_ASSEM 阅读全文
posted @ 2020-12-14 13:49 不再低调 阅读(1240) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-以指定字符分割字符串 1 std::vector<std::string> SplitString(std::string str, const std::string& seperator) 2 { 3 std::vector<std::string> result; 4 int 阅读全文
posted @ 2020-12-14 13:30 不再低调 阅读(328) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-获取当前项目路径 1 std::string AskProjectPath() 2 { 3 char* userDir = NULL; 4 UF_translate_variable("UGII_USER_DIR", &userDir); 5 if (userDir == NULL) 阅读全文
posted @ 2020-12-14 13:27 不再低调 阅读(414) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-根据文件名删除文件 1 void DeleteFileByFileName(const std::string& fileName) 2 { 3 if (CheckFileExist(fileName)) 4 { 5 remove(fileName.c_str()); 6 } 7 } 阅读全文
posted @ 2020-12-14 13:25 不再低调 阅读(241) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-写入信息窗口 1 void WriteLW(const std::string& str) 2 { 3 NXOpen::ListingWindow *lw = Session::GetSession()->ListingWindow(); 4 if (!lw->IsOpen()) 5 阅读全文
posted @ 2020-12-14 13:23 不再低调 阅读(250) 评论(0) 推荐(0) 编辑
摘要: #NX二次开发-读文件 1 bool ReadFile(const std::string& fileName, std::vector<std::string>& txtLines) 2 { 3 if (!CheckFileExist(fileName)) 4 { 5 return false; 阅读全文
posted @ 2020-12-14 13:18 不再低调 阅读(403) 评论(0) 推荐(0) 编辑