我在交互式环境中试过,我在4月5号贴的那个件中,如果交互式中filter设为body,选择时得选很多次。
因此,我在4月5号的帖子的前半部分代码是:
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, §ion_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, §ion_curves_feature))]
请高手帮看看红颜色处的用法是否正确,或者如果整个代码不对,请指教!! |