- 积分
- 0
- 注册时间
- 2010-4-20
- 仿真币
-
- 最后登录
- 1970-1-1
|
悬赏10仿真币未解决
先说明下目的,读取text文件内的坐标值(已附上),格式大致为[23,13,100],[25,34,100].......想通过PCL语言读取目标文件夹内的(patran属性设置的新目录,这里是E:\pcltest ),中的testcood.txt文件。 然后采用asm_const_grid_xyz 函数 定义POINT, 我附上自己做的PCL程序,因为是新手 所以这里有很多错误,也有很多问题,请大家指教,问题如下:
1. 调用built-in 函数,内部的变量在函数外需要定义吗,如何不用定义,貌似用!!library?
2. text_read()中的init 格式如何设置, 文本中都是[XXX,XXX,XXX], 的格式,如何设置?
3.每次定义POINT时,如何自动设置点号?
谢谢了 希望给出完整代码
代码如下:
!!library
function outputpoint()
string filename[20]
integer Flag
integer status
integer chan
string line
integer lenline
string string_temp[virtual]
STRING s_coordinates_list[32]
STRING s_coord_frame[32]
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
string s_output_ids
filename="example"
status=text_open(testcood,"OR",0,0,chan)
if(status!=0)then
user_message("ERROR",0,"Open file","cann't open file")
else if(status==0)then
while(text_read_string(chan,line,lenline)==0)
Flag=str_index(line,"[")
$write(line,flag)
if(Flag>=1)then
text_read(chan,"A%",string_temp)
end if
end while
end if
s_output_ids = "1"
s_coord_frame = "Coord 0"
i_return_value = @
asm_const_grid_xyz @
( s_output_ids, @
s_coordinates_list, @
string_temp @
sv_created_ids )
dump i_return_value
dump sv_created_ids
text_close(chan,"")
end function |
|