|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在打开的零件上生成截面线,现在平面生成了 但截面线不出来 斑竹能帮我看看哪个地方不对吗?
void ufusr(char *param, int *retcode, int param_len)
{
if (!UF_CALL(UF_initialize()))
{
char part_fspec[MAX_FSPEC_SIZE+1];
int curr_part, num_parts;
int type;
int count_1;
tag_t part;
tag_t feature;
/* Get the total number of loaded parts. */
num_parts = UF_PART_ask_num_parts();
for ( curr_part=0 ; curr_part < num_parts ; curr_part++ )
{
/* Get the part tag for the current part number of the
loaded part and get its part name.
*/
part = UF_PART_ask_nth_part( curr_part );
UF_PART_ask_part_name( part, part_fspec );
printf( title0, part_fspec );
count_1 = 0;
type = UF_feature_type;
feature = NULL_TAG;
/* Start the cycling process by passing in a NULL_TAG. */
UF_OBJ_cycle_objs_in_part( part, type, &feature );
/* Keep cycling until there are no more features to cycle. */
while ( feature != NULL_TAG )
{
count_1++;
UF_OBJ_cycle_objs_in_part( part, type, &feature );
FILE *fp3;
if((fp3=fopen("e:\\my_source\\line4.txt","w"))==NULL)
{
printf("could not open data file.");
exit(0);
}
fprintf(fp3,"UF_OBJ_cycle_objs_in_part shows features is %d \n",&feature);
}
FILE *fp2;
if((fp2=fopen("e:\\my_source\\line3.txt","w"))==NULL)
{
printf("could not open data file.");
exit(0);
}
fprintf(fp2,"UF_OBJ_cycle_objs_in_part shows %d features\n",count_1);
}
double origin_point[3];
double pl1_normal[3];
origin_point[0] = 0.0;
origin_point[1] = 40.0;
origin_point[2] = 30.0;
pl1_normal[0] = 0.0;
pl1_normal[1] = 0.0;
pl1_normal[2] = 1.0;
tag_t plane1_tag;
tag_t objects[1], planes[1];
UF_CALL(UF_MODL_create_plane(origin_point, pl1_normal, &plane1_tag));
double point_data[3];
UF_CURVE_line_t line_data;
UF_CURVE_section_general_data_t general_data;
UF_CURVE_section_planes_data_t planes_data;
UF_CURVE_section_parallel_data_t parallel_data;
UF_CURVE_section_radial_data_t radial_data;
UF_CURVE_section_perpcrv_data_t perpcrv_data;
tag_t section_curves_feature;
objects[0] = feature;
planes[0] = plane1_tag;
general_data.associate = 1;
general_data.objects = objects;
general_data.num_objects = 1;
general_data.grouping = 0;
general_data.join_type = 0;
general_data.tolerance = 0.0254;
planes_data.planes = planes;
planes_data.num_planes = 1;
UF_CURVE_section_from_planes (&general_data, &planes_data,
§ion_curves_feature);
UF_CALL(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY); |
|