NX二次开发-UFUN打开本地文本文档uc4504
NX9+VS2012
#include <uf.h>
#include <uf_cfi.h>
#include <uf_ui.h> using std::string; UF_initialize(); //内容1
//读取文本全部内容
//打开本地文本文档
int Chan = uc4504("D:\\123.txt", , );//类型为只读,后缀类型txt为79。帮助有写到,自己去查。 //读取打开的文本文档
char *Cbuf;
int Num = uc4514a(Chan, &Cbuf);//只能读一行 UF_UI_open_listing_window();
//循环去读每一行
while ( Num>= )
{
//打印
strcat(Cbuf, "\n");//拼接字符串换行
UF_UI_write_listing_window(Cbuf);
Num = uc4514a(Chan, &Cbuf);
} //释放内存
UF_free(Cbuf); //关闭文本文档
uc4540(Chan, ); //================================================================================= /*
//内容2
//向文本写入内容
//打开本地文本文档
int Chan1 = uc4504("D:\\456.txt", 3, 209);//类型为写和替换,后缀类型CPP为209。帮助有写到,自己去查。 //写入内容
uc4524(Chan1, "Hello,World"); //关闭文本
uc4540(Chan1, 0); //================================================================================= //内容3
//读取部分内容
//打开txt
int WenJian = uc4504("D:\\789.txt", 1, 79); //读数据
char *OutDate;
int Date1 = uc4514a(WenJian, &OutDate); UF_UI_open_listing_window();
char BufLeft[256], BufRight[256];//左值,右值
while (Date1 >= 0)
{
//提取左右值
string S1 = OutDate;
string Strleft = (S1.substr(0, S1.find(",")));//提取左值
string Strright = (S1.substr(S1.find(",") + 1, S1.find("。")));//提取右值 //将string类型转换为字符数组
strcpy(BufLeft, Strleft.c_str());
strcpy(BufRight, Strright.c_str()); //打印
UF_UI_write_listing_window(BufLeft);
UF_UI_write_listing_window("\n"); Date1 = uc4514a(WenJian, &OutDate);
} //释放内存
UF_free(OutDate); //关闭文件
uc4540(WenJian, 0);
*/ UF_terminate(); Caesar
2018年10月21日



老函数uc4514
//读取文本全部内容
//打开本地文本文档
int ioChannelNum = uc4504("C:\\PS_List\\List.txt", , ); //读取打开的文本文档
char readBuf[];
int readLen = uc4514(ioChannelNum, readBuf);//只能读一行 UF_UI_open_listing_window(); //循环去读每一行
while ( readLen>= )
{
//打印
strcat(readBuf, "\n");//拼接字符串换行
UF_UI_write_listing_window(readBuf);
readLen = uc4514(ioChannelNum, readBuf);
} //关闭文本文档
uc4540(ioChannelNum, );
NX二次开发-UFUN打开本地文本文档uc4504的更多相关文章
- NX二次开发-UFUN读取本地文本文档uc4514a
1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_cfi.h> 5 #include <uf_ui.h> 6 7 us ...
- NX二次开发-UFUN关闭本地文本文档uc4540
1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_cfi.h> 5 #include <uf_ui.h> 6 7 us ...
- NX二次开发-UFUN写入本地文本文档uc4524
1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_cfi.h> 5 #include <uf_ui.h> 6 7 us ...
- NX二次开发-UFUN打开信息窗口UF_UI_open_listing_window()
NX9+VS2012 #include <uf.h> #include <uf_ui.h> UF_initialize(); //方法1(uc1601) uc1601();// ...
- NX二次开发-UFUN打开工程图UF_DRAW_open_drawing
NX9+VS2012 #include <uf.h> #include <uf_draw.h> #include <uf_part.h> UF_initialize ...
- NX二次开发-UFUN打开二进制STL文件函数UF_STD_open_binary_stl_file
NX9+VS2012 #include <uf.h> #include <uf_obj.h> #include <uf_modl.h> #include <u ...
- NX二次开发-UFUN打开选择文件夹对话框UF_UI_create_filebox
#include <uf.h> #include <uf_ui.h> #include <string> using namespace std; string O ...
- NX二次开发-Ufun API Example
UF公共类型 UF_begin_timer计时函数 https://www.cnblogs.com/nxopen2018/p/10957135.html UF_end_timer计时函数 https: ...
- NX二次开发-UFUN将工程图转成CGM和PDF文件UF_CGM_export_cgm
文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...
随机推荐
- Security基础(一):Linux基本防护措施、使用sudo分配管理权限、提高SSH服务安全
一.Linux基本防护措施 目标: 本案例要求练习Linux系统的基本防护措施,完成以下任务: 修改用户zhangsan的账号属性,设置为2015-12-31日失效(禁止登录) 锁定用户lisi的账户 ...
- Python之-异常处理
1.python中处理异常的方式 #coding:utf8 filename=raw_input("请输入你要操作的文件") try: f=open(filename) print ...
- 《ArcGIS Runtime SDK for .NET开发笔记》--在线编辑
介绍 ArcGIS可以发布具有编辑功能的Feature Service.利用Feature Service我们可以实现对数据的在线编辑. 数据制作参考: https://server.arcgis.c ...
- MySQL coalesce函数用法说明(转)
在mysql中,其实有不少方法和函数是很有用的,一个叫coalesce的,作用是将返回传入的参数中第一个非null的值,比如 SELECT COALESCE(NULL, NULL, 1); -- Re ...
- 86、使用Tensorflow实现,LSTM的时间序列预测,预测正弦函数
''' Created on 2017年5月21日 @author: weizhen ''' # 以下程序为预测离散化之后的sin函数 import numpy as np import tensor ...
- (转)Git 提交的正确姿势:Commit message 编写指南
Git 每次提交代码,都要写 Commit message(提交说明),否则就不允许提交. $ git commit -m "hello world" 上面代码的-m参数,就是用来 ...
- 【C++第一个Demo】---控制台RPG游戏1【游戏简介】
经过1个月的制作和多次修改,终于有了基本雏形(此篇仅用于纪念历时3个多月C/C++学习所付出努力,也给和我一样苦恼于不能快速理解面向对象的同学们一点灵感) 在制作这个Demo过程中也受到了很多大 ...
- html 局部打印
首先有个调用的方法.printView(). function printView() { bdhtml = window.document.body.innerHTML;//获取当前页的html代码 ...
- 嵌入式C语言4.2 C语言内存空间的使用-指针与修饰符:const,volatile,typedef
const:变量,只读[不能变] 内存属性: 1. 内存操作的大小 2.内存的变化性,可写可读 char *p; const char *p; 描述字符串,p指向的内容是只读的,不可再次修改 ...
- flask获取参数
<!DOCTYPE html> body, html { width: 100%; height: 100%; } , ::after, ::before { -webkit-box-si ...