|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请教各位高手:
在应用UG_function编程中,我做了line1,line2两条线,利用line1做了turb特征,想用line2替换line1重新定义turb的中心线,但使用
UF_MODL_replace_sweep_curve或UF_MODL_edit_sweep_curve无法完成? Unigraphics Startup
// This entry point activates the application at Unigraphics startup
extern "C" DllExport void ufsta( char *param, int *returnCode, int rlen )
{
/* Initialize the API environment */
int errorCode = UF_initialize();
if ( 0 == errorCode )
{
/* TODO: Add your application code here */
tag_t line1,line2;
UF_CURVE_line_t sline1,sline2;
sline1.start_point[0]=0;
sline1.start_point[1]=0;
sline1.start_point[2]=0;
sline1.end_point[0]=0;
sline1.end_point[1]=100;
sline1.end_point[2]=0;
UF_CURVE_create_line([$sline1,&line1)]
sline2.start_point[0]=0;
sline2.start_point[1]=0;
sline2.start_point[2]=0;
sline2.end_point[0]=100;
sline2.end_point[1]=100;
sline2.end_point[2]=0;
UF_CURVE_create_line([$sline2,&line2)]
uf_list_p_t path_list, turb_feature_list ;
char * turb_limit[2]={"13","0"};
UF_MODL_create_list([$path_list)]
UF_MODL_put_list_item(path_list,line1);
UF_MODL_create_tube ( path_list,turb_limit,UF_NULLSIGN, [$turb_feature_list )]
int n_eids;
tag_t *eids ;
tag_t turb_feature_id,turb_obj_id;
UF_MODL_ask_list_item(turb_feature_list,0,[$turb_feature_id)]
UF_MODL_ask_feat_object (turb_feature_id,[$n_eids,&eids)]
int i;
turb_obj_id=eids[0];
int n_pro,n_guid;
tag_t *pro,*guide;
UF_MODL_ask_sweep_curves(turb_obj_id,[$n_pro,&pro,&n_guid,&guide)]
for (i=0;i<n_guid;i++)
{UF_DISP_set_highlight(guide,1);}
int rr;
rr= UF_MODL_replace_sweep_strings (turb_feature_id,
0,NULL,
0,NULL,
n_guid,guide,
1,[$line2)]
/*rr=UF_MODL_edit_sweep_curves (turb_obj_id,0,NULL,0,NULL,n_guid,guide,n_guid,[$line2)] */
rr=UF_UI_open_listing_window ( );
if(rr==0)
UF_UI_write_listing_window("success\n");
else
{UF_UI_write_listing_window("unsuccess\n");
return;
} |
|