各位版主,大家好!在此,感谢各位的帮助。我这个问题,可以说是重提了,希望能帮助解决。我有如下代码:
static void do_section(void)
{
tag_t autobody_tag,part_tag,section_tag;
double section_point[3];
double plane_normal[3];
tag_t *objects;
tag_t planes[1];
int type, subtype;
UF_CURVE_section_general_data_t general_data;
UF_CURVE_section_planes_data_t planes_data;
UF_CURVE_section_parallel_data_t parallel_data;
tag_t section_curves_feature,*section_curves;
int num_section_curves;
int num_objects1=0;
part_tag = UF_PART_ask_display_part();
autobody_tag = NULL_TAG;
UF_OBJ_cycle_objs_in_part(part_tag, UF_solid_type, [$autobody_tag)]
while(autobody_tag!=NULL_TAG)
{
UF_OBJ_ask_type_and_subtype(autobody_tag, [$type, &subtype)]
if(subtype ==UF_solid_face_subtype)
{
num_objects1++;
objects=[$autobody_tag]
}
UF_OBJ_cycle_objs_in_part(part_tag, UF_solid_type, [$autobody_tag)] }
section_point[0] = 0.0;
section_point[1] = 20.0;
section_point[2] = 0.0;
plane_normal[0] = 0.0;
plane_normal[1] = 1.0;
plane_normal[2] = 0.0;
UF_CALL(UF_MODL_create_plane(section_point, plane_normal, [$section_tag))]
planes[0] = section_tag;
general_data.associate = 1;
general_data.objects = objects;
general_data.num_objects =num_objects1;
general_data.grouping = 0;
general_data.join_type = 0;
general_data.tolerance = 0.0254;
planes_data.planes = planes;
planes_data.num_planes = 1;
UF_CALL (UF_CURVE_section_from_planes (&general_data, &planes_data,
[$section_curves_feature))]
printf (" section curves feature tag is %d\n", section_curves_feature);
parallel_data.base_plane = section_tag;
parallel_data.step_distance = 50.0;
parallel_data.start_distance = 0.0;
parallel_data.end_distance = 500.0;
UF_CALL (UF_CURVE_section_from_parallel_planes (&general_data,¶llel_data,
[$section_curves_feature))]
UF_CALL (UF_CURVE_ask_feature_curves (section_curves_feature,
[$num_section_curves, §ion_curves))]
UF_free (section_curves);
}
我用这段代码对如下图的件做截面线,总是不行,我还改变许多别的方式,都没成功,请版主帮忙看一下,谢谢!!! |