Copyright (c) 1999 Unigraphics Solutions Inc.
Unpublished - All rights reserved
================================================================================
File description:
An example UG/Open program is contained in this file demonstrating
usage of the following UG/Open interfaces:
1) Creates a part file named "curve_trim".
2) Creates two lines. One to be trimmed and one as the bounding string.
It also creates a fixed datum plane for a second bounding object.
3) Creates a trim curve feature that trims the first line to the
bounding string.
4) Retrieves the parameters of the trim curve feature.
5) Edits the trim curve feature so that the first line is now trimmed to
the bounding string and the fixed datum plane.
6) Frees the information retrieved from the UF_CURVE_ask_trim call.
/*
Fill in arrays to be used in string definition.
*/
trim_string[0] = 2; trim_dir[0] = 1;
/*
Fill in trim curve structure information to trim the first line
to the second line as a bounding string.
*/
trim_curve_info.string_to_trim.num = 1;
trim_curve_info.string_to_trim.string = trim_string;
trim_curve_info.string_to_trim.dir = trim_dir;
trim_curve_info.string_to_trim.id = lines;
/*
Fill in arrays to be used in bound definition.
*/
bound_string[0] = 1; bound_dir[0] = 1;
/*
Fill in bounding information.
*/
trim_curve_info.trim_to.one_bound.string_trim_extend_end = UF_CURVE_TRIM_EXTEND_START;
/*
Ask the parameters of the trim curve feature just created.
*/
UF_CALL(UF_CURVE_ask_trim(trim_curve_feat, [$out_trim_curve_info))]
/*
Transfer some of the retrieved parameters to the trim curve
information structure.
Reset other information in the structure so that the first line
will now be trimmed so that the portion of the line outside the
bounding string and the datum plane will be trimmed away.
*/
trim_curve_info.string_to_trim = out_trim_curve_info.string_to_trim;
trim_curve_info.trim_type = UF_CURVE_TRIM_TO_TWO_BOUND;
trim_curve_info.trim_to.two_bound.string_extend_end = UF_CURVE_TRIM_EXTEND_START;
trim_curve_info.trim_to.two_bound.string_trim_option = UF_CURVE_TRIM_OUTSIDE;
trim_curve_info.trim_to.two_bound.bound1.string =
out_trim_curve_info.trim_to.one_bound.bound.string;
trim_curve_info.trim_to.two_bound.bound1.object = NULL_TAG;
trim_curve_info.trim_to.two_bound.bound2.string.num = 0;
trim_curve_info.trim_to.two_bound.bound2.object = datum;
trim_curve_info.trim_to.two_bound.bound2.use_suggested = FALSE;
trim_curve_info.trim_to.two_bound.view = (void *)0;
/*
Edit the trim curve feature.
*/
UF_CALL(UF_CURVE_edit_trim(trim_curve_feat, [$trim_curve_info))]
/*
Update the model.
*/
UF_CALL(UF_MODL_update());
printf("Trim curve feature edited, and model updated\n");
/*
Free the retrieved information.
*/
UF_CALL(UF_CURVE_free_trim([$out_trim_curve_info))]
printf("Trim curve feature information freed, and example completed.\n");
}
/*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);
}
The following structure allows definition of a vector
with a variety of options. Note that associativity to
any data is not maintained unless otherwise specified.
Data Members
reverse_vector
int reverse_vector
Indicates if the vector calculated should then be reversed before being used. If zero, the vector is not reversed. Any other value will reverse the vector.
vector_type
UF_MODL_vector_type_t vector_type
Indication of which structure is being used to define the vector.
defined_by
UF_MODL_vector_defined_by_union_t defined_by
The definition of the vector.