购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_MODL_create_circular_iset( int method, double location [ ], double axis [ 3 ], char * number_str, char * angle_str, uf_list_p_t feature_list, tag_t * feature_obj_id) 函数说明:
创建一个圆形的实例,使用旋转点设置功能,旋转轴,实例的数目,旋转角度和选择的列表特征。此函数的输出是相关联的对象标识符到圆形的实例集。不同的实例集将在feature_list每个项目创建。(除基准轴。参见基准轴线以下使用)。 feature_obj_id意志创建最后一个实例设置功能的标识符。要查询的其他ID实例设置功能,调用UF_MODL_ask_instance_iset在各个项目功能列表作为一个参数。您可以使用基准轴为旋转轴。要做到这一点的地方标签在feature_list年底基准轴。然后初始化位置和轴数组参数,即使他们不使用。使用基准轴被联想的优势。要查询此实例创建的实例集使用功能UF_MODL_ask_instance该方法选项对应于什么是可用的交互。看到建模用户手册。
函数参数:
第1个参数为输入:
输入int 整数型的参数,参数的变量格式为method,方法:0 =1 =2简单=相同
第2个参数为输入:
输入double 双精度类型的参数,参数的变量格式为location [ ],旋转点。
第3个参数为输入:
输入double 双精度类型的参数,参数的变量格式为axis [ 3 ],旋转轴。
第4个参数为输入:
输入char * 字符类型的参数,参数的变量格式为number_str,实例的数量。
第5个参数为输入:
输入char * 字符类型的参数,参数的变量格式为angle_str,旋转角度。
第6个参数为输入:
feature_list代表参数变量,uf_list_p_t 为输入参数类型,选定的功能列表。
第7个参数为输出:
feature_obj_id代表参数变量,tag_t * 为输出参数类型,创建ISET特征对象标识符
UF_MODL_create_circular_iset函数实例代码演示:
打开C造型创建下面的示例创建一个盖板,直径两英寸,0.25英寸高度气缸与在中心具有0.5625英寸的孔。 有一个即在一个圆形阵列,在120度实例化0.21875英寸的孔区间。该代码会产生如下图所示的图形。图圆形实例设置

[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_modl.h>
#include <uf_disp.h>
#include <uf_part.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)
{
double origin[3] = {0.0, 0.0, 0.0};
double orig_iset[3] = {0.0, -0.75, 0.0};
double direction[3] = {0.0, 0.0, 1.0};
char *height = ".25";
char *diam_cover = "2.0";
char *diam_hole = "0.5625";
char *diam_iset = "0.21875";
char *part_name = "cover";
UF_FEATURE_SIGN create = UF_NULLSIGN;
UF_FEATURE_SIGN sub = UF_NEGATIVE;
tag_t cover_id, hole_id, iset_id, feat_obj, part;
uf_list_p_t feat_list;
int english_units = 2;
UF_CALL(UF_PART_new(part_name, english_units, &part));
UF_CALL(UF_MODL_create_cyl1(create,origin,height,diam_cover,directi
on,
&cover_id));
UF_CALL(UF_MODL_create_cyl1(sub,origin,height,diam_hole,direction,
&hole_id));
UF_CALL(UF_MODL_create_cyl1(sub,orig_iset,height,diam_iset,directio
n,
&iset_id));
UF_CALL(UF_MODL_create_list(&feat_list));
UF_CALL(UF_MODL_put_list_item(feat_list,iset_id));
UF_CALL(UF_MODL_create_circular_iset(0,origin,direction,"3","120",
feat_list,&feat_obj));
UF_CALL(UF_MODL_delete_list(&feat_list));
UF_CALL(UF_PART_save());
}
/*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]