to haiying:
我试你所说的方法,还是不行的。
下面是最简单的代码。
int units=1;
tag_t part_tag;
char part_name[132]="c:\\block.prt";
long error_code;
error_code=UF_PART_new(part_name,units,[$part_tag)]
char *block_len[3] = {"10","10","5"};
tag_t block_feat_id;
double block_origin[3] = {0.0,0.0,0.0};
UF_FEATURE_SIGN sign = UF_NULLSIGN;
error_code=UF_MODL_create_block1(sign,block_origin,block_len,[$block_feat_id)]
tag_t tag_iso;
error_code=UF_OBJ_cycle_by_name( "TFR-ISO", [$tag_iso )]
double dwg_reference_point[2]={0,0};
UF_DRAW_view_info_t view_info;
tag_t draw_view_tag;
tag_t drawing_tag;
error_code=UF_DRAW_ask_current_drawing([$drawing_tag)]
UF_DRAW_initialize_view_info( [$view_info )]
error_code=UF_DRAW_import_view(drawing_tag,tag_iso,dwg_reference_point,[$view_info,&draw_view_tag)]
上述代码在运行中,UF_DRAW_ask_currrent_drawing会出错,错误提示
是“there is no current drawing”。
如果在程序中去掉函数UF_DRAW_ask_currrent_drawing,用part_tag代替UF_DRAW_import_view中的drawing_tag,则UF_DRAW_import_view出错,错误提示是内存访问越界。
请问是由于函数使用不当,还是改函数不适合??
请高手指点这是怎么回事??
谢谢!! |