点击查看详细介绍

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

misnn 10年前 1306 0

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


函数结构:
UF_MODL_edit_slot_type
(
tag_t slot_feature,
UF_MODL_slot_type_e_t new_slot_type
)

函数说明:
改变槽特征的类型。新字段初始化为在上面的表中所示。如果你想改变这些字段,需要修改他们的表情。

函数参数:
第1个参数为输入:
slot_feature代表参数变量,tag_t 为输入参数类型,插槽功能

第2个参数为输入:
new_slot_type代表参数变量,UF_MODL_slot_type_e_t 为输入参数类型,新的插槽类型。有效的类型有:UF矩形槽UF BALL_END_SLOT,UF_U_SLOT UF_T_SLOT,UF_DOVE_TAIL_SLOT

UF_MODL_edit_slot_type函数实例代码演示:
下面的例子需要一个开放,空白部分。 代码创建一个块和一个矩形槽。然后,该代码更改retangular槽一球结束插槽。该代码添加THRU面的插槽。
[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, placement_face, thru_face1 = NULL_TAG,
thru_face2 = NULL_TAG, slot_feature;
tag_t new_thru_faces[2];
double origin[3]={0.0,0.0,0.0};
double x_direction[3]={1.0,0.0,0.0};
double direction[3]={0.0,0.0,1.0};
double location[3]={150,12.5,150};
int num_faces = 2;
char *edge_lens[3]={"300.0","25.0","150.0"};
char *width="1.0";
char *depth="5.0";
char *distance="2.0";
UF_MODL_slot_type_e_t new_slot_type = UF_BALL_END_SLOT;
uf_list_p_t uflist;
/* Create a block and put a retangular slot in it. */
UF_CALL(UF_MODL_create_block1(UF_NULLSIGN,
origin,
edge_lens,
&block_tag));
UF_CALL(UF_MODL_create_list(&uflist));
UF_CALL(UF_MODL_ask_feat_faces(block_tag,
&uflist));
UF_CALL(UF_MODL_ask_list_item(uflist,
0,
&placement_face));
UF_CALL(UF_MODL_ask_list_item(uflist,
2,
&new_thru_faces[0]));
UF_CALL(UF_MODL_ask_list_item(uflist,
5,
&new_thru_faces[1]));
UF_MODL_delete_list(&uflist);
UF_CALL(UF_MODL_create_rect_slot(location,
direction,
x_direction,
width,
depth,
distance,
placement_face,
thru_face1,
thru_face2,
&slot_feature));
/* Change the slot from a retangular to ball end. */
if(UF_CALL(UF_MODL_edit_slot_type(slot_feature,
new_slot_type)))
{
/* error check */
}
/* Add thru faces. */
if(UF_CALL(UF_MODL_add_thru_faces(slot_feature,
num_faces,
new_thru_faces)))
{
/* 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)
请登录后发表新帖