点击查看详细介绍

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

misnn 7年前 688 0

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


函数结构:
UF_MODL_redefine_replace_faces
(
tag_t feature_eid,
int number_of_faces,
tag_t face_eids [ ]
)

函数说明:
替换当前组输入与该组的面输入的面通过参数面。

函数参数:
第1个参数为输入:
feature_eid代表参数变量,tag_t 为输入参数类型,OFFSET或空心功能

第2个参数为输入:
输入int 整数型的参数,参数的变量格式为number_of_faces,在脸上阵面数

第3个参数为输入:
face_eids [ ]代表参数变量,tag_t 为输入参数类型,面的阵列,以取代在特征当前输入面。

UF_MODL_redefine_replace_faces函数实例代码演示:
下面的例子需要一个开放,空白部分。 代码创建一个块和镂空它。然后,该代码更改面对皮尔斯为空心。
[quote]
#include <stdio.h>
#include <uf_modl.h>
#include <uf.h>
#include <uf_curve.h>
#include <uf_csys.h>
#include <uf_defs.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 block_tag, hollow_feature;
tag_t pierce_face, new_pierce_face;
double origin[3]={0.0,0.0,0.0};
char *edge_lens[3]={"300.0","25.0","150.0"};
char *thickness="0.1";
uf_list_p_t uflist;
/* Create a block. */
UF_CALL(UF_MODL_create_block1(UF_NULLSIGN,
origin,
edge_lens,
&block_tag));
UF_CALL(UF_MODL_ask_feat_faces(block_tag,
&uflist));
UF_CALL(UF_MODL_ask_list_item(uflist,
0,
&pierce_face));
UF_CALL(UF_MODL_ask_list_item(uflist,
2,
&new_pierce_face));
UF_MODL_delete_list(&uflist);
UF_MODL_create_list(&uflist);
UF_MODL_put_list_item(uflist,
pierce_face);

/* Hollow the block */
UF_CALL(UF_MODL_create_hollow(thickness,
uflist,
&hollow_feature));
UF_MODL_delete_list(&uflist);
/* Change the pierce face of the hollow. */
if(UF_CALL(UF_MODL_redefine_replace_faces(hollow_feature,
1,
&new_pierce_face)))
{
/* error check */
}
/* Trigger update */
if(UF_CALL(UF_MODL_update()))
{
/* error check */
}
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int paramLen)
{
if (!UF_CALL(UF_initialize()))
{
do_ugopen_api();
UF_CALL(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}



[/quote]

0

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