点击查看详细介绍

UF_MODL_delete_body_parms() 函数的参数解释说明、函数详细用法,以及实例代码演示

misnn 6年前 1546 0

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


函数结构:
UF_MODL_delete_body_parms
(
uf_list_p_t body_list
)

函数说明:
可以删除输入列表中的固体的所有参数。

函数参数:
第1个参数为输入:
body_list代表参数变量,uf_list_p_t 为输入参数类型,固体的名单

UF_MODL_delete_body_parms函数实例代码演示:
下面的示例删除所选实体的所有参数身体。
[quote]
#include <stdlib.h>
#include <stdio.h>
#include <uf.h>
#include <uf_modl.h>
#include <uf_ui.h>
#include <uf_object_types.h>
#include <uf_disp.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
static int report( char *file, int line, char *call, int irc)
{
if (irc)
{
char messg[133];
printf("%s, line %d: %s\n", file, line, call);
(UF_get_fail_message(irc, messg)) ?
printf(" returned a %d\n", irc) :
printf(" returned error %d: %s\n", irc, messg);
}
return(irc);
}
static void do_ugopen_api(void)
{
tag_t body,view;
UF_UI_selection_options_t opts;
UF_UI_mask_t mask = {UF_solid_type,0,UF_UI_SEL_FEATURE_BODY};
uf_list_p_t delete_body_list;
int error = 0, response = 2, zero = 0;
double cursor[3];
opts.num_mask_triples = 1;
opts.mask_triples = &mask;
opts.scope = UF_UI_SEL_SCOPE_WORK_PART;

error = UF_UI_select_single("Select a solid body",
&opts,
&response,
&body,cursor,&view);
if (!error && response != 1 && response != 2)
{ /* if there's no error & response is not CANCEL or BACK */
/* Create a list to put the solid body in */
UF_CALL(UF_MODL_create_list(&delete_body_list));
UF_CALL(UF_MODL_put_list_item(delete_body_list, body));
/* Deleting all of the parametric information from the */
/* solid body in the delete_body_list.*/
UF_CALL(UF_MODL_delete_body_parms(delete_body_list));
UF_CALL(UF_MODL_delete_list(&delete_body_list));
/* unhighlight selected body */
UF_CALL(UF_DISP_set_highlight(body,zero));
}
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int param_len)
{
if (!UF_CALL(UF_initialize()))
{
do_ugopen_api();
UF_CALL(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}



[/quote]

0

最新回复 (0)
请登录后发表新帖