随笔分类 -  NX二次开发-文件操作

NX二次开发-创建目录
摘要:NX二次开发-创建目录 1 bool CreateDir(string path) 2 { 3 if (path.empty()) 4 { 5 return false; 6 } 7 8 CreateDirectory(multiByteToWideChar(path), NULL); 9 10 r 阅读全文
posted @ 2021-02-04 15:51 不再低调 阅读(181) 评论(0) 推荐(0)
NX二次开发-检查文件夹是否存在
摘要:NX二次开发-检查文件夹是否存在 1 bool CheckFolderExist(const string & strPath) 2 { 3 if (strPath.empty()) 4 { 5 return false; 6 } 7 8 WIN32_FIND_DATA wfd; 9 BOOL bV 阅读全文
posted @ 2021-02-04 15:50 不再低调 阅读(206) 评论(0) 推荐(0)
NX二次开发-检查文件是否存在
摘要:NX二次开发-检查文件是否存在 UF函数 1 bool CheckFileExists(string filename) 2 { 3 if (filename.empty()) 4 { 5 return false; 6 } 7 8 int status = 1; 9 UF_CFI_ask_file 阅读全文
posted @ 2021-02-04 15:36 不再低调 阅读(237) 评论(0) 推荐(0)
NX二次开发-拆分路径为文件夹和文件名
摘要:#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 不再低调 阅读(383) 评论(0) 推荐(0)
NX二次开发-根据文件名删除文件
摘要:#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 不再低调 阅读(314) 评论(0) 推荐(0)
NX二次开发-写入信息窗口
摘要:#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 不再低调 阅读(320) 评论(0) 推荐(0)
NX二次开发-读文件
摘要:#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 不再低调 阅读(501) 评论(0) 推荐(0)