Overview

These functions work on STEP measures, which are encoded as measure_with_unit instances. A measure combines a value with a unit and subtypes for specific value types (lengths, angles, etc). When the measure is part of a representation, it is also combined with representation_item as a complex instance.

These functions are defined in the stix_measure.h header file.

Use stix_get_measure_value() to get the numeric value of a measure, and stix_get_unit_type() to get its unit. Qualified measures may have an upper limit, lower limit, or precision value. All of these functions return ROSE_NULL_REAL if a measure has no numeric value or given qualifier.

The stix_get_measure_item() function searches through a representation to find a measure with a partiular type of value or name. There are wrappers around stix_get_measure_value() and stix_get_measure_item() for each of the different types of value: angle, count, linear speed, length, pressure, ratio, rotational speed, and time. The wrappers simply clarify what type of value code is working with and pick the right kind of unit from a RoseUnitSet if one is given for a conversion.

The various "make" functions are for creating new instances. The stix_make_measure_value() function creates an populates a select type instance while the stix_make_measure_rep_item() and stix_make_measure() functions create measures with unit and use the appropriate subtype or complex instance combinations for the value.

stix_get_angle_item()

stp_measure_representation_item * stix_get_angle_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_angle_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure item that holds a plane angle measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_angle_value()

double stix_get_angle_value (
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

double stix_get_angle_value (
        stp_measure_with_unit * mwu, 
        RoseUnitSet * uset
        );

The stix_get_angle_value() function is a wrapper around stix_get_measure_value() that returns the numeric value of a measure item, possibly converted to a different unit. If no unit parameter is provided, the value is returned as-is. If a RoseUnitSet parameter is given, the value will be converted to the angle unit of the set.

stix_get_count_item()

stp_measure_representation_item * stix_get_count_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_count_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure item that holds a count measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_count_value()

double stix_get_count_value (
        stp_measure_with_unit * mwu
        );  // unitless

The stix_get_count_value() function returns the numeric value of a measure item. Count values never need unit conversion so no additional parameters are required. This is a simple wrapper around stix_get_measure_value() that makes the type of the value clearer in code.

stix_get_descriptive_item()

stp_descriptive_representation_item * stix_get_descriptive_item (
        stp_representation * rep, 
        const char * desired_name
        );

The stix_get_descriptive_item() function is a wrapper around stix_get_rep_item() that searches the items set of a representation to find a descriptive representation item. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_descriptive_value()

char * stix_get_descriptive_value (
        stp_representation * rep, 
        const char * desired_name = 0
        );

char * stix_get_descriptive_value (
        stp_measure_with_unit * mwu
        );

The stix_get_descriptive_value() function returns a string description value. There are two versions of this function. The first version is a wrapper around stix_get_descriptive_item() that searches a representation. The second version operates on a measure with unit. Measures are normally numeric values, but they can hold a descriptve string instead. The function returns a null pointer if no descriptive value can be found.

stix_get_feedrate_item()

stp_measure_representation_item * stix_get_feedrate_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_feedrate_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure representation item that holds a linear speed measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_feedrate_value()

double stix_get_feedrate_value (
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

double stix_get_feedrate_value (
        stp_measure_with_unit * mwu, 
        RoseUnitSet * uset
        );

The stix_get_feedrate_value() function is a wrapper around stix_get_measure_value() that returns the numeric value of a measure item, possibly converted to a different unit. If no unit parameter is provided, the value is returned as-is. If a RoseUnitSet parameter is given, the value will be converted to the linear speed unit of the set.

stix_get_length_item()

stp_measure_representation_item * stix_get_length_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_length_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure representation item that holds a length measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_length_value()

double stix_get_length_value (
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

double stix_get_length_value (
        stp_measure_with_unit * mwu, 
        RoseUnitSet * uset
        );

The stix_get_length_value() function is a wrapper around stix_get_measure_value() that returns the numeric value of a measure item, possibly converted to a different unit. If no unit parameter is provided, the value is returned as-is. If a RoseUnitSet parameter is given, the value will be converted to the length unit of the set.

stix_get_measure_current_value()

double stix_get_measure_current_value(
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

The stix_get_measure_current_value() function returns the current value of a qualified measure if one is present, and ROSE_NULL_REAL if one is not. The current value is described by the same unit as the main (nominal) value, which is returned by stix_get_unit_type(). You can pass an optional unit parameter if you would like the value converted to a particular unit. If a measure has a current value, it must be a subtype of qualified_representation_item. See stix_get_measure_lower_limit_value, stix_get_measure_upper_limit_value, and stix_get_measure_precision_value for other qualifiers.

stix_get_measure_item()

stp_measure_representation_item * stix_get_measure_item(
        stp_representation * rep, 
        const char *  desired_name, 
        RoseMeasureType desired_mt
        );

The stix_get_measure_item() function searches the items set within a representation for a measure that matches the type of value given by "desired_mt". If "desired_name" is not null, the measure must also have that string as the rep item name.

stp_representation * some_rep;

stp_measure_representation_item * mri = 
    stix_get_measure_item (some_rep, "box height", rosemeasure_length);

stix_get_measure_lower_limit_value()

double stix_get_measure_lower_limit_value(
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

The stix_get_measure_lower_limit_value() function returns the lower limit value of a measure if one is present, and ROSE_NULL_REAL if one is not. The limit value is described by the same unit as the main (nominal) value, which is returned by stix_get_unit_type(). You can pass an optional unit parameter if you would like the value converted to a particular unit. If a measure has a limit value, it must be a subtype of qualified_representation_item. See stix_get_measure_upper_limit_value and stix_get_measure_precision_value for other qualifiers.

stix_get_measure_precision_value()

int stix_get_measure_precision_value(
        stp_measure_with_unit * mwu
        );

The stix_get_measure_precision_value() function returns the digits of precision for a measure if one is present, and ROSE_NULL_INT if one is not. If a measure has a precision value, it must be a subtype of qualified_representation_item. See stix_get_measure_lower_limit_value and stix_get_measure_upper_limit_value for other qualifiers.

stix_get_measure_std_uncertainty()

stp_standard_uncertainty * stix_get_measure_std_uncertainty(
        stp_qualified_representation_item * qri,
        const char * qualname
        )

stp_standard_uncertainty * stix_get_measure_std_uncertainty(
        stp_measure_with_unit * mwu, 
        const char * qualname
        )

The stix_get_measure_std_uncertainty() function searches for a standard_uncertainty instance with a given name in the list of qualifiers in a qualified representation item. The function has several prototypes to simplify programming, but the supplied object must have qualified_representation_item as a type.

stix_get_measure_upper_limit_value()

double stix_get_measure_upper_limit_value(
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

The stix_get_measure_upper_limit_value() function returns the lower limit value of a measure if one is present, and ROSE_NULL_REAL if one is not. The limit value is described by the same unit as the main (nominal) value, which is returned by stix_get_unit_type(). You can pass an optional unit parameter if you would like the value converted to a particular unit. If a measure has a limit value, it must be a subtype of qualified_representation_item. See stix_get_measure_lower_limit_value and stix_get_measure_precision_value for other qualifiers.

stix_get_measure_value()

double stix_get_measure_value(
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

The stix_get_measure_value() function returns the numeric value of a measure if one is present, and ROSE_NULL_REAL if the value is null or a descriptive string value. The function takes an optional unit parameter if you would like the value converted to a particular unit. You can find the unit of the value with the stix_get_unit_type() function.

stix_get_pressure_item()

stp_measure_representation_item * stix_get_pressure_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_pressure_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure representation item that holds a pressure measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_pressure_value()

double stix_get_pressure_value (
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

double stix_get_pressure_value (
        stp_measure_with_unit * mwu, 
        RoseUnitSet * uset
        );

The stix_get_pressure_value() function is a wrapper around stix_get_measure_value() that returns the numeric value of a measure item, possibly converted to a different unit. If no unit parameter is provided, the value is returned as-is. If a RoseUnitSet parameter is given, the value will be converted to the pressure unit of the set.

stix_get_ratio_item()

stp_measure_representation_item * stix_get_ratio_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_ratio_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure representation item that holds a ratio measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_ratio_value()

double stix_get_ratio_value (
        stp_measure_with_unit * mwu
        );  // unitless

The stix_get_ratio_value() function returns the numeric value of a measure item. Ratio values never need unit conversion so no additional parameters are required. This is a simple wrapper around stix_get_measure_value() that makes the type of the value clearer in code.

stix_get_rep_item()

stp_representation_item * stix_get_rep_item (
        stp_representation * rep, 
        RoseDomain * targ_type, 
        const char * targ_name
        );

The stix_get_rep_item() function searches the items set within a representation for a representation_item that matches the EXPRESS type given by "targ_type". If "targ_name" is not null, the item must also have that string as the rep item name. This is more general than stix_get_measure_item() because it works on any type of representation item.

stix_get_spinrate_item()

stp_measure_representation_item * stix_get_spinrate_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_spinrate_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure representation item that holds a rotational speed measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_spinrate_value()

double stix_get_spinrate_value (
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

double stix_get_spinrate_value (
        stp_measure_with_unit * mwu, 
        RoseUnitSet * uset
        );

The stix_get_spinrate_value() function is a wrapper around stix_get_measure_value() that returns the numeric value of a measure item, possibly converted to a different unit. If no unit parameter is provided, the value is returned as-is. If a RoseUnitSet parameter is given, the value will be converted to the rotational speed unit of the set.

stix_get_time_item()

stp_measure_representation_item * stix_get_time_item (
        stp_representation * rep, 
        const char * desired_name = 0
        );

The stix_get_time_item() function is a wrapper around stix_get_measure_item() that searches the items set of a representation to find a measure representation item that holds a time measure. If the desired_name parameter is not null, the name attribute of the representation item must also match it exactly.

stix_get_time_value()

double stix_get_time_value (
        stp_measure_with_unit * mwu, 
        RoseUnit u = roseunit_as_is
        );

double stix_get_time_value (
        stp_measure_with_unit * mwu, 
        RoseUnitSet * uset
        );

stix_make_angle_measure()

stp_plane_angle_measure_with_unit * stix_make_angle_measure(
        RoseDesign * design,
        double value, 
        RoseUnit ut
        );

The stix_make_angle_measure() function is just a wrapper around stix_make_measure(). Both functions return the same object, but this version casts the return pointer to the angle-specific subtype for use in places that require the pointer as the more specific type.

stix_make_angle_measure_item()

stp_measure_representation_item_and_plane_angle_measure_with_unit * stix_make_angle_measure_item(
        RoseDesign * design,
        double value, 
        RoseUnit ut
        );

The stix_make_angle_measure_item() function is just a wrapper around stix_make_measure_item(). Both functions return the same object, but this version casts the return pointer to the angle-specific representation item subtype for use in places that require the pointer as the more specific type.

stix_make_length_measure()

stp_length_measure_with_unit * stix_make_length_measure(
        RoseDesign * design,
        double value, 
        RoseUnit ut
        );

The stix_make_length_measure() function is just a wrapper around stix_make_measure(). Both functions return the same object, but this version casts the return pointer to the length-specific subtype for use in places that require the pointer as the more specific type.

stix_make_length_measure_item()

stp_length_measure_with_unit_and_measure_representation_item * stix_make_length_measure_item(
        RoseDesign * design,
        double value, 
        RoseUnit ut
        );

The stix_make_length_measure_item() function is just a wrapper around stix_make_measure_item(). Both functions return the same object, but this version casts the return pointer to the length-specific representation item subtype for use in places that require the pointer as the more specific type.

stix_make_measure()

stp_measure_with_unit * stix_make_measure(
        RoseDesign * design,
        double value, 
        RoseUnit ut
        );

The stix_make_measure() function creates a new measure instance to describe the given number and with the STEP data for a given RoseUnit in the provided design. The instance will not be a representation_item subtype (use stix_make_measure_item() for that), but the function will create a value-specific subtype if needed.

The stix_make_angle_measure(), stix_make_length_measure(), and stix_make_ratio_measure() wrappers call this function and cast the result for situations that require a more specific pointer type.

stix_make_measure_item()

stp_measure_representation_item * stix_make_measure_item(
        RoseDesign * design,
        double value, 
        RoseUnit ut
        );

The stix_make_measure_item() function creates a new measure instance for use in a representation. The instance will describe the given number with the STEP data for a given RoseUnit in the provided design. The function will create instance using any subtypes or complex instance combinations that might be required for type of value.

The stix_make_angle_measure_item(), stix_make_length_measure_item(), and stix_make_ratio_measure_item() wrappers call this function and cast the result for situations that require a more specific pointer type.

RoseDesign * d;

// Make a 27.3 mm rep item instance
stp_measure_representation_item * box_height =
        stix_make_measure_item (d, 27.3, roseunit_mm);

stix_make_measure_value()

stp_measure_value * stix_make_measure_value(
        RoseDesign * design,
        double value, 
        RoseMeasureType mt
        );

The stix_make_measure_value() function creates a new measure value select type to describe the given number in the provided design. The value type parameter gives the type of quantity (length, angle, etc) described by the number.

stix_make_qualified_measure_item()

stp_qualified_representation_item * stix_make_qualified_measure_item(
        RoseDesign * d,
        double value, 
        RoseUnit ut
        );

The stix_make_qualified_measure_item() function creates a new measure instance for use in a representation. The result is a complex instance of qualified representation item, measure representation item, and if applicable, a measure with unit subtype. As with stix_make_measure_item(), the resulting object is initialized with the supplied value and unit information.

Use the stix_put_measure_lower_limit_value(), stix_put_measure_upper_limit_value(), and stix_put_measure_precision_value() functions to set additional qualifiers on the result.

stix_make_ratio_measure()

stp_ratio_measure_with_unit * stix_make_ratio_measure(
        RoseDesign * design,
        double value, 
        RoseUnit ut = roseunit_ratio
        );

The stix_make_ratio_measure() function is just a wrapper around stix_make_measure(). Both functions return the same object, but this version casts the return pointer to the ratio-specific subtype for use in places that require the pointer as the more specific type.

Since ratio measures normally do not have a specific unit, this function uses a default parameter of roseunit_ratio

stix_make_ratio_measure_item()

stp_measure_representation_item_and_ratio_measure_with_unit * stix_make_ratio_measure_item(
        RoseDesign * design,
        double value, 
        RoseUnit ut = roseunit_ratio
        );

The stix_make_ratio_measure_item() function is a wrapper around stix_make_measure_item(). Both functions return the same object, but this version casts the return pointer to the ratio-specific representation item subtype for use in places that require the pointer as the more specific type.

Since ratio measures normally do not have a specific unit, this function uses a default parameter of roseunit_ratio

stix_make_time_measure()

stp_time_measure_with_unit * stix_make_time_measure(
        RoseDesign * d,
        double value, 
        RoseUnit ut
        );

The stix_make_time_measure() function is just a wrapper around stix_make_measure(). Both functions return the same object, but this version casts the return pointer to the time-specific subtype for use in places that require the pointer as the more specific type.

stix_make_time_measure_item()

stp_measure_representation_item_and_time_measure_with_unit * stix_make_time_measure_item(
        RoseDesign * d,
        double value, 
        RoseUnit ut
        );

The stix_make_time_measure_item() function is a wrapper around stix_make_measure_item(). Both functions return the same object, but this version casts the return pointer to the time-specific representation item subtype for use in places that require the pointer as the more specific type.

stix_put_measure_lower_limit_value()

stp_standard_uncertainty * stix_put_measure_lower_limit_value(
        stp_qualified_representation_item * it,
        double limval
        );

The stix_put_measure_lower_limit_value() function finds or adds a standard_uncertainty instance with a name of "lower limit" to the list of qualifiers in a qualified representation item. Then the function sets the numeric value to the given number and returns the standard_uncertainty. If the numeric value is ROSE_NULL_REAL, any existing lower limit will be removed and the function will return null.

Use stix_make_qualified_measure_item() to create a measure instance that can hold an upper or lower limit.

stix_put_measure_precision_value()

stp_precision_qualifier * stix_put_measure_precision_value(
        stp_qualified_representation_item * it,
        int precval
        );

The stix_put_measure_precision_value() function finds or adds a precision_qualifier instance to the list of qualifiers in a qualified representation item. Then the function sets the numeric value to the given number and returns the precision_qualifier.

If the numeric value is ROSE_NULL_INT, any existing precision qualifier will be removed and the function will return null.

stix_put_measure_std_uncertainty()

stp_standard_uncertainty * stix_put_measure_std_uncertainty(
        stp_qualified_representation_item * qri,
        const char * qualname,
        double qualval
        );

The stix_put_measure_std_uncertainty() function finds or adds a standard_uncertainty instance with a given name to the list of qualifiers in a qualified representation item. Then the function sets the numeric value to the given number and returns the standard_uncertainty.

If the numeric value is ROSE_NULL_REAL, any existing standard_uncertainty qualifier with that name name will be removed and the function will return null. This function is the general form of the stix_put_measure_lower_limit_value() and stix_put_measure_upper_limit_value() functions.

stix_put_measure_upper_limit_value()

stp_standard_uncertainty * stix_put_measure_upper_limit_value(
        stp_qualified_representation_item * it,
        double limval
        );

The stix_put_measure_upper_limit_value() function finds or adds a standard_uncertainty instance with a name of "upper limit" to the list of qualifiers in a qualified representation item. Then the function sets the numeric value to the given number and returns the standard_uncertainty. If the numeric value is ROSE_NULL_REAL, any existing upper limit will be removed.

Use stix_make_qualified_measure_item() to create a measure instance that can hold an upper or lower limit.