Dimensions and Parameters
This section describes the Creo Object TOOLKIT C++ methods and classes that affect dimensions and parameters.
Overview
Dimensions and parameters in Creo Parametric have similar characteristics but also have significant differences. In Creo Object TOOLKIT C++, the similarities between dimensions and parameters are contained in the pfcBaseParameter interface. This interface allows access to the parameter or dimension value and to information regarding a parameter's designation and modification. The differences between parameters and dimensions are recognizable because pfcDimension inherits from the interface pfcModelItem, and can be assigned tolerances, whereas parameters are not pfcModelItems and cannot have tolerances.
The ParamValue Object
Both parameters and dimension objects contain an object of type pfcParamValue. This object contains the integer, real, string, or Boolean value of the parameter or dimension. Because of the different possible value types that can be associated with a pfcParamValue object there are different methods used to access each value type and some methods will not be applicable for some pfcParamValue objects. If you try to use an incorrect method an exception will be thrown.
Accessing a ParamValue Object
Methods Introduced:
The pfcModelItem utility class contains methods for creating each type of pfcParamValue object. Once you have established the value type in the object, you can change it. The method pfcBaseParameter::GetValue returns the pfcParamValue associated with a particular parameter or dimension.
A NotepfcParamValue is an integer value that refers to the ID of a specified note. To create a parameter of this type the identified note must already exist in the model.
Accessing the ParamValue Value
Methods Introduced:
The method pfcParamValue::Getdiscr returns a enumeration object that identifies the type of value contained in the pfcParamValue object. Use this information with the Get and Set methods to access the value. If you use an incorrect Get or Set method an exception of type pfcXBadGetParamValue will be thrown.
Parameter Objects
The following sections describe the Creo Object TOOLKIT C++ methods that access parameters. The topics are as follows:
Creating and Accessing Parameters
Methods Introduced:
In Creo Object TOOLKIT C++, models, features, surfaces, and edges inherit from the pfcParameterOwner interface, because each of the objects can be assigned parameters in Creo Parametric.
The method pfcParameterOwner::GetParam gets a parameter given its name.
The method pfcParameterOwner::ListParams returns a sequence of all parameters assigned to the object.
To create a new parameter with a name and a specific value, call the method pfcParameterOwner::CreateParam.
To create a new parameter with a name, a specific value, and units, call the method pfcParameterOwner::CreateParamWithUnits.
The method pfcParameterOwner::SelectParam allows you to select a parameter from the Creo Parametric user interface. The top model from which the parameters are selected must be displayed in the current window.
The method pfcParameterOwner::SelectParameters allows you to interactively select parameters from the Creo Parametric Parameter dialog box based on the parameter selection options specified by the pfcParameterSelectionOptions object. The top model from which the parameters are selected must be displayed in the current window. Refer to the section Parameter Selection Options for more information.
The method pfcFamColParam::GetRefParam returns the reference parameter from the parameter column in a family table.
The method wfcWParameterOwner::ApplyParameterTableset assigns the specified parameter set to the parameter owner modelitem. You can create or modify the parameters called by the parameter table set, that is, you can modify the entries contained in this parameter table set, change the label set for the parameter table set and alter the name of the table that owns this parameter table set. The values specified for the parameters, are set as the default values for the parameters.
Note
This method does not regenerate the model on applying the parameter set.
A parameter table simplifies storing and accessing the value sets used for manipulating dimensions and parametric information. Parameter tables maintain design intent, while allowing adjustment for different parameter values. As the global parameters are numeric or have a value of yes or no, they control the dimension values of the components and the mathematical relations between them in an assembly. A parameter table makes it easy to switch between different configuration options of an assembly. The method wfcWParameterOwner::ExportParameterTable exports a file containing information about the parameter table in Creo Parametric to a specified format. The input parameters for this method are:
•  TopMdl—Specify the top level model from which parameters are to be exported.
•  Contexts—Specifies a bitmask that contains the context of parameters to list in the exported file. Specify a context only if the argument owner is set to NULL. The list of contexts is specified by the enum pfcParameterSelectionContext and the valid combinations of the context are:
  pfcPARAMSELECT_ALLOW_SUBITEM_SELECTION used alone—Specifies that all the parameters of the sub items of the top model will be exported.
  pfcPARAMSELECT_ALLOW_SUBITEM_SELECTION along with any another context—Specifies that only the parameters that belong to the selected context will be exported.
  pfcPARAMSELECT_MODEL, pfcPARAMSELECT_PART or pfcPARAMSELECT_ASM—Specifies that all the model level parameters in the top model will be exported.
•  ExportType—Specify the format of the exported file. The supported formats are defined by the enumerated type wfcParamTableExportType and are as follows:
  wfcPARAMTABLE_EXPORT_TXT—Specifies that the file will be exported in a .TXT format.
  wfcPARAMTABLE_EXPORT_CSV—Specifies that the file will be exported in a .CSV format.
•  Path—Specify the full path, including the name and the extension of the file to be created during export.
•  Columns—Specifies a list that contains the description about the number of columns to be included in the exported file. The columns exported will match the columns and options set by the user in the active session using File ▶ Export in the Parameters dialog box to export the entire parameter table in the Comma Separated Value (CSV) format. This parameter is not applicable for the text format. You can also specify the type of parameter table column to be included in the export file using the enumerated type wfcParamColumn.
•  Owner—Specify the owner modelitem of the parameters to be exported. Set this parameter to NULL, if the parameters to be exported are selected by context.
Parameter Selection Options
Parameter selection options in Creo Object TOOLKIT C++ are represented by the pfcParameterSelectionOptions interface.
Methods Introduced:
The method pfcParameterSelectionOptions::Create creates a new instance of the pfcParameterSelectionOptions object that is used by the method pfcParameterOwner::SelectParameters.
The parameter selection options are as follows:
•  AllowContextSelection—This boolean attribute indicates whether to allow parameter selection from multiple contexts, or from the invoking parameter owner. By default, it is false and allows selection only from the invoking parameter owner. If it is true and if specific selection contexts are not yet assigned, then you can select the parameters from any context.
Use the method pfcParameteSelectionOptions::SetAllowContextSelection to modify the value of this attribute.
•  Contexts—The permitted parameter selection contexts in the form of the pfcParameterSelectionContexts object. Use the method pfcParameterSelectionOptions::SetContexts to assign the parameter selection context. By default, you can select parameters from any context.
•  The types of parameter selection contexts are as follows:
  pfcPARAMSELECT_MODEL—Specifies that the top level model parameters can be selected.
  pfcPARAMSELECT_PART—Specifies that any part’s parameters (at any level of the top model) can be selected.
  pfcPARAMSELECT_ASM—Specifies that any assembly’s parameters (at any level of the top model) can be selected.
  pfcPARAMSELECT_FEATURE—Specifies that any feature’s parameters can be selected.
  pfcPARAMSELECT_EDGE—Specifies that any edge’s parameters can be selected.
  pfcPARAMSELECT_SURFACE—Specifies that any surface’s parameters can be selected.
  pfcPARAMSELECT_QUILT—Specifies that any quilt’s parameters can be selected.
  pfcPARAMSELECT_CURVE—Specifies that any curve’s parameters can be selected.
  pfcPARAMSELECT_COMPOSITE_CURVE—Specifies that any composite curve’s parameters can be selected.
  pfcPARAMSELECT_INHERITED—Specifies that any inheritance feature’s parameters can be selected.
  pfcPARAMSELECT_SKELETON—Specifies that any skeleton’s parameters can be selected.
  pfcPARAMSELECT_COMPONENT—Specifies that any component’s parameters can be selected.
•  AllowMultipleSelections—This boolean attribute indicates whether or not to allow multiple parameters to be selected from the dialog box, or only a single parameter. By default, it is true and allows selection of multiple parameters.
Use the method pfcParameterSelectionOptions::SetAllowMultipleSelections to modify this attribute.
•  SelectButtonLabel—The visible label for the select button in the dialog box.
Use the method pfcParameterSelectionOptions::SetSelectButtonLabel to set the label. If not set, the default label in the language of the active Creo Parametric session is displayed.
Parameter Information
Methods Introduced:
Parameters inherit methods from the pfcBaseParameter, pfcParameter and pfcNamedModelItem interfaces.
The method pfcBaseParameter::GetValue returns the value of the parameter or dimension.
The method pfcBaseParameter::SetValue assigns a particular value to a parameter or dimension.
The method pfcParameter::GetScaledValue returns the parameter value in the units of the parameter, instead of the units of the owner model as returned by pfcBaseParameter::GetValue.
The method pfcParameter::SetScaledValue assigns the parameter value in the units provided, instead of using the units of the owner model as assumed by pfcBaseParameter::GetValue.
The method pfcParameter::GetUnits returns the units assigned to the parameter.
You can access the designation status of the parameter using the methods pfcBaseParameter::GetIsDesignated and pfcBaseParameter::SetIsDesignated.
The methods pfcBaseParameter::GetIsModified and pfcBaseParameter::ResetFromBackup enable you to identify a modified parameter or dimension, and reset it to the last stored value. A parameter is said to be "modified" when the value has been changed but the parameter's owner has not yet been regenerated.
The method pfcParameter::GetDescription returns the parameter description, or null, if no description is assigned.
The method pfcParameter::SetDescription assigns the parameter description.
The method pfcParameter::GetRestriction identifies if the parameter’s value is restricted to a certain range or enumeration. It returns the pfcParameterRestriction object. Refer to the section Parameter Restrictions for more information.
The method pfcParameter::GetDriverType returns the driver type for a material parameter. The driver types are as follows:
•  pfcPARAMDRIVER_PARAM—Specifies that the parameter value is driven by another parameter.
•  pfcPARAMDRIVER_FUNCTION—Specifies that the parameter value is driven by a function.
•  pfcPARAMDRIVER_RELATION—Specifies that the parameter value is driven by a relation. This is equivalent to the value obtained using pfcGetIsRelationDriven for a parameter object type.
The method pfcParameter::Reorder reorders the given parameter to come immediately after the indicated parameter in the Parameter dialog box and information files generated by Creo Parametric.
The method pfcParameter::Delete permanently removes a specified parameter.
The method pfcNamedModelItem::GetName accesses the name of the specified parameter.
The method wfcWParameter::GetLockStatus returns the access state of the specified parameter. Use the function wfcWParameter::SetLockStatus to set the access state for the specified parameter. The access state is defined in the enumerated data type wfcParamLockstatus. The valid values are:
•  wfcPARAMLOCKSTATUS_UNLOCKED—Specifies parameters with full access. Full access parameters are user-defined parameters that can be modified from any application.
•  wfcPARAMLOCKSTATUS_LIMITED—Specifies parameters with limited access. Full access parameters can be set to have limited access. Limited access parameters can be modified by user, family tables and programs. These parameters cannot be modified by relations.
•  wfcPARAMLOCKSTATUS_LOCKED—Specifies parameters with locked access are parameters. The parameters can be locked either by an external application, or by the user. You can modify parameters locked by an external application only from within an external application. You cannot modify user-defined locked parameters from within an external application.
The methods wfcWParameter::GetValueWithUnits and wfcWParameter::SetValueWithUnits reads and sets the value of a parameter specified by the wfcParamValueWithUnits object. These methods also retrieve and set the units of the parameter.
Use the method wfcParamValueWithUnits::Create to create the wfcParamValueWithUnits object, which contains information about the parameter.
The methods wfcParamValueWithUnits::GetValue and wfcParamValueWithUnits::SetValue get and set the value of the parameter. Use the methods wfcParamValueWithUnits::GetUnits and wfcParamValueWithUnits::SetUnits to get and set the units of the parameter.
Use the method wfcParameterData::Create to create the wfcParameterData object, which contains information or data about the parameter. The input parameters are:
•  Name—Specifies the name of the parameter.
•  Value—Specifies the value of the parameter.
•  Unit—Specifies the unit of the parameter.
Use the method wfcParameterData::GetName to retrieve the name of the parameter.
Use the method wfcParameterData::GetUnits to retrieve the units of the parameter.
Use the method wfcParameterData::GetValue to retrieve the value of the parameter.
The method wfcParameterConflict::Create creates a report which checks if the restricted value parameters in the model are in agreement with an external file. The input parameters are:
•  Name— Specifies the name of the parameter in conflict.
•  Severity—Specifies the severity of the conflict.
•  Description—Specifies the description of the parameter in conflict.
Use the method wfcParameterConflict::GetConflictDescription to retrieve the description of the parameter in conflict.
Use the method wfcParameterConflict::GetConflictSeverity to retrieve the severity of the conflict using the enumerated type wfcParameterConflictSeverity.
Use the method wfcParameterConflict::GetParameterName to retrieve the name of the parameter in conflict.
Parameter Restrictions
Creo Parametric allows users to assign specified limitations to the value allowed for a given parameter (wherever the parameter appears in the model). You can only read the details of the permitted restrictions from Creo Object TOOLKIT C++, but not modify the permitted values or range of values. Parameter restrictions in Creo Object TOOLKIT C++ are represented by the interface pfcParameterRestriction.
Method Introduced:
The method pfcParameterRestriction::GetType returns the pfcRestrictionType object containing the types of parameter restrictions. The parameter restrictions are of the following types:
•  pfcPARAMSELECT_ENUMERATION—Specifies that the parameter is restricted to a list of permitted values.
•  pfcPARAMSELECT_RANGE—Specifies that the parameter is limited to a specified range of numeric values.
Enumeration Restriction
The pfcPARAMSELECT_ENUMERATION type of parameter restriction is represented by the interface pfcParameterEnumeration. It is a child of the pfcParameterRestriction interface.
Method Introduced:
The method pfcParameterEnumeration::GetPermittedValues returns a list of permitted parameter values allowed by this restriction in the form of a sequence of the pfcParamValue objects.
Range Restriction
The pfcPARAMSELECT_RANGE type of parameter restriction is represented by the interface pfcParameterRange. It is a child of the pfcParameterRestriction interface.
Methods Introduced:
The method pfcParameterRange::GetMaximum returns the maximum value limit for the parameter in the form of the pfcParameterLimit object.
The method pfcParameterRange::GetMinimum returns the minimum value limit for the parameter in the form of the pfcParameterLimit object.
The method pfcParameterLimit::GetType returns the pfcParameterLimitType containing the types of parameter limits. The parameter limits are of the following types:
•  pfcPARAMLIMIT_LESS_THAN—Specifies that the parameter must be less than the indicated value.
•  pfcPARAMLIMIT_LESS_THAN_OR_EQUAL—Specifies that the parameter must be less than or equal to the indicated value.
•  pfcPARAMLIMIT_GREATER_THAN—Specifies that the parameter must be greater than the indicated value.
•  pfcPARAMLIMIT_GREATER_THAN_OR_EQUAL—Specifies that the parameter must be greater than or equal to the indicated value.
The method pfcParameterLimit::GetValue returns the boundary value of the parameter limit in the form of the pfcParamValue object.
Table Parameters
A parameter table is made up of one or more parameter table sets. Each set represents one or more parameters with their assigned values or assigned ranges. A parameter owner such as model, feature, annotation element or geometry item can only have one parameter table set to create a parameter. In Creo Object TOOLKIT C++, a parameter table set is represented by the type wfcParamtableSet and is made up of entries, represented by  wfcParamTableEntry. A single entry represents a parameter with an assigned value or range.
Use the method wfcParamTableEntry::GetName to obtain the name of the parameter in the table set.
Use the method wfcParamTableEntry::GetRange to obtain the permitted range for the parameter in the table set. This method returns an object of the class pfcParameterRange. Use the methods pfcParameterRange::GetMaximum and pfcParameterRange::GetMinimum to get the minimum and maximum value for the parameter. For more information on these methods refer to the section Parameter Restrictions.
Use the method wfcParamTableEntry::GetValue to get the value set for a parameter in the table set.
Use the method wfcWParameter::GetTableset to obtain the parameter table set that contains the specified parameter.
Use the method wfcParamTableset::GetEntries to get the list of parameters present in the parameter table set. This method returns an array of parameter table set which contains information about all the parameters defined.
Use the method wfcParamTableset::GetLabel to get the set label parameter defined for the parameter table set. A parameter that describes an entire set of parameters and their values is called a set label parameter.
Use the method wfcParamTableset::GetTablePath to get the name of the table that owns that parameter table set. If the parameter table set has been loaded from a table file, this method returns the full path of the table. It returns the table name, if the table parameter table set is stored in the model directly.
Driven and Driving Parameters
Driven or dependent parameters are controlled by the equation you define. Driven parameters enable you to set particular values for a dimension, drive the value of one dimension based on the behavior of another dimension, and dynamically suppress features based on changes in the part. Driving or independent parameters on the other hand are capable of controlling an activity and their value does not change often unlike driving parameters. The methods described below provide access to the item, that is, parameter or method driving model parameters. You can use Creo Parametric parameters to define the characteristics of your material properties with either driven or driving parameters.
If the driver type defined by pfcParameterDriverType is set to pfcPARAMDRIVER_PARAM, the method wfcWParameter::GetDrivingParam returns the name of the driving parameter for the specified material parameter.
Use the method wfcWParameter::SetDrivingParam to assign the driving parameter for a material parameter. This method will set the driver type to pfcPARAMDRIVER_PARAM.
Dimension Objects
Dimension objects include standard Creo Parametric dimensions as well as reference dimensions. Dimension objects enable you to access dimension tolerances and enable you to set the value for the dimension. Reference dimensions allow neither of these actions.
Getting Dimensions
Dimensions and reference dimensions are Creo Parametric model items. See the section Getting ModelItem Objects for methods that can return pfcDimension and pfcRefDimension objects.
Dimension Information
Methods Introduced:
All the pfcBaseParameter methods are accessible to Dimensions as well as Parameters. See the section Parameter Objects for brief descriptions.
Note
You cannot set the value or designation status of reference dimension objects.
The methods pfcBaseDimension::GetDimValue and pfcBaseDimension::SetDimValue access the dimension value as a double. These methods provide a shortcut for accessing the dimensions' values without using a ParamValue object.
The pfcBaseParameter::GetIsRelationDriven method identifies whether the part or assembly relations control a dimension.
The method pfcBaseDimension::GetDimType returns an enumeration object that identifies whether a dimension is linear, radial, angular, or diametrical.
The method pfcBaseDimension::GetSymbol returns the dimension or reference dimension symbol (that is, “d#” or “rd#”).
The methods pfcBaseDimension::GetTexts and pfcBaseDimension::SetTexts allow access to the text strings that precede or follow the dimension value.
The method wfcWDimension::GetBound returns the bound values of a dimension using the enumerated data type wfcDimBound. When you design a model, the actual part dimensions must be within certain predetermined limits of size. These limits of size—the upper and lower dimension boundaries—are known as dimension bounds. Refer to the section Modifying Dimensions for more information on bound values.
The method wfcWDimension::GetNominalValue returns the nominal value of a dimension. The method returns the nominal value even if the dimension is set to the upper or lower bound. The nominal value is returned in degrees for an angular dimension and in the system of units for other types of dimensions.
The method wfcWDimension::GetSymbolModeText returns the text of the dimension in symbol mode.
The method wfcWDimension::IsFractional checks whether the dimension is expressed in terms of a fraction rather than a decimal.
The method wfcWDimension::IsBasic identifies if the specified dimension is a basic dimension.
The method wfcWDimension::IsInspection identifies if the specified dimension is an inspection dimension.
The method wfcWDimension::GetOwnerFeature returns the feature that owns the specified dimension.
Use the method wfcWDimension::IsDisplayedValueRounded to determine whether the specified dimension is set to display its rounded off value.
In Creo TOOLKIT, a rounded off value is a decimal value that contains only the desired number of digits after the decimal point. For example, if a dimension has the stored value 10.34132 and you want to display only two digits after the decimal point, you must round off the stored value to two decimal places. Thus, rounding off converts 10.34132 to 10.34.
Use the method wfcWDimension::DisplayValueAsRounded to set the attribute of the given dimension to display either the rounded off value or the stored value.
You can use this method for all dimensions, except angular dimensions created prior to Pro/ENGINEER Wildfire 4.0, ordinate baseline dimensions, and dimensions of legacy type. For these dimensions, the method throws an exception pfcXToolkitNotValid.
If you choose to display the rounded off value, the method wfcWDimension::GetDisplayedValue retrieves the displayed rounded value of the specified dimension. Otherwise, it retrieves the stored value.
The method wfcWDimension::GetOverrideValue returns the override value for a dimension. The default override value is zero.
Note
The override value is available only for driven dimensions.
Use the method wfcWDimension::GetDisplayedValueType to obtain the type of value displayed for a dimension using the enumerated type wfcDimValueDisplay. The valid types are:
•  wfcDIMVALUEDISPLAY_NOMINAL—Displays the actual value of the dimension along with the tolerance value.
•  wfcDIMVALUEDISPLAY_OVERRIDE—Displays the override value for the dimension along with the tolerance value.
•  wfcDIMVALUEDISPLAY_HIDE—Displays only the tolerance value for the dimension.
When you set a negative value to a dimension, it will either change the dimension to this negative value, or flip the direction around its reference and show a positive value dimension instead. Use the method wfcWDimension::IsSignDriven to check this. The method returns the following values:
•  true—When the negative sign in the dimension value is used to flip the direction.
•  false—When the negative sign is used to indicate a negative value, that is, the dimension is negative.
The configuration option show_dim_sign when set to yes allows you to display negative dimensions in the Creo Parametric user interface.
When the option is set no, the dimensions always show positive value. However, in this case, if you set a negative value for the dimension, the direction is flipped.
Note
Some feature types, such as, dimensions for coordinate systems and datum point offsets, always show negative or positive values, even if the option is set to no. These features do not depend on the configuration option.
The method wfcWDimension::IsAccessibleInModel identifies if a specified dimension is owned by the model. When a model owns the dimension, then by default, the dimension is accessible in the model.
The method wfcWDimension::GetSignificantDigits retrieves the number of decimals digits that are significant for a dimension or tolerance. If you specify the input argument Tolerance as false, the method retrieves the number of decimals digits that are significant for the dimension.
If you want to get the number of decimal places shown for the upper and lower values of the dimension tolerance, specify the input argument Tolerance as true.
The method wfcWDimension::GetDenominator retrieves the value of the largest possible denominator that is used to define a fractional value or tolerance. If you specify the input argument Tolerance as false, the method returns the value of the largest possible denominator used to define the fractional value.
If you want to get the value for the largest possible denominator for the upper and lower tolerance values, specify the input argument Tolerance as true. By default, this value is defined by the config.pro option, dim_fraction_denominator.
Modifying Dimensions
Methods Introduced:
The method wfcWDimension::SetBound sets the bound status of the dimension using the enumerated type wfcDimBound. The valid values are:
•  wfcDIM_BOUND_NOMINAL—Sets the dimension value to the nominal value. It generates geometry based on exact ideal dimensions.
•  wfcDIM_BOUND_UPPER—Sets the dimension value to its maximum value. It generates geometry based on a nominal dimension value plus the tolerance.
•  wfcDIM_BOUND_LOWER—Sets the dimension value to its minimum value. It generates geometry based on a nominal dimension value minus the tolerance.
•  wfcDIM_BOUND_MIDDLE—Sets the dimension value to the nominal value plus the mean of the upper and lower tolerance values.
The methods wfcWDimension::SetAsBasic and wfcWDimension::SetAsInspection set the basic and inspection notations of the dimension respectively. These methods are applicable to both driven and driving dimensions.
Note
The basic and inspection notations of the dimension are not available when only the tolerance value for a dimension is displayed.
The method wfcWDimension::SetOverrideValue assigns the override value for a dimension. This value is restricted to real numbers. The default override value is zero.
Note
You can set the override value only for driven dimensions.
The method wfcWDimension::SetDisplayedValueType sets the type of value to be displayed for a dimension using the enumerated data type wfcDimValueDisplay.
The method wfcWDimension::SetElbowLength sets the length of the elbow for the specified dimension in a solid. The method can also be used to set the length of the elbow for a dimension in a drawing, where the dimension is created in a solid and is displayed in a drawing. To work with dimensions shown in a drawing, pass the name of the drawing in the input argument Drw.
The method wfcWDimension::CreateSimpleBreak creates a simple break on an existing dimension witness line. The input arguments are:
•  Drawing—Specifies the drawing in which the dimension is present. You can specify a NULL value.
•  WitnessLineIndex—Specifies the index of the witness line. Depending on which side of the dimension the witness line lies, specify the value as 1 or 2. Use the methods wfcDimLocation::GetFirstWitnessLineLocation or wfcDimLocation::GetSecondWitnessLineLocation to get the location of the witness line end points for a dimension.
Note
This argument is not applicable for ordinate, radius, and diameter dimensions.
•  BreakStart—Specifies the start point of the break.
•  BreakEnd—Specifies the end point of the break.
The method wfcWDimension::CreateJog creates a jog on an existing dimension witness line. The input arguments are:
•  Drawing—Specifies the drawing in which the dimension is present. You can specify a NULL value.
•  WitnessLineIndex—Specifies the index of the witness line. Depending on which side of the dimension the witness line lies, specify the value as 1 or 2. Use the methods wfcDimLocation::GetFirstWitnessLineLocation or wfcDimLocation::GetSecondWitnessLineLocation to get the location of the witness line end points for a dimension.
Note
This argument is not applicable for ordinate, radius, and diameter dimensions.
•  JogPoints—Specifies an array of points to position the jog. If the specified witness line has no jog added to it, then you must specify minimum two points that is, the start point and end point of the jog.
Note
The methods wfcWDimension::CreateSimpleBreak and wfcWDimension::CreateJog throw an exception pfcXToolkitInvalidType when breaks and jogs are not supported for the specified dimension type, for example, diameter dimension. The methods throw an exception pfcXToolkitAbort when it is not possible to create breaks or jogs for the specified dimension witness line. For example, if you add a jog that is duplicate to an existing jog on the dimension witness line.
When you create a dimension, witness lines are created based on the dimension placement location and dimension references. These witness lines do not overlap with the reference geometry.
The method wfcWDimension::EraseWitnessLine erases a specified witness line from the dimension. The input arguments are:
•  Drawing—Specifies the drawing in which the dimension is displayed. To erase witness line from a solid, specify this argument as NULL.
•  WitnessLineIndex—Specifies the index of the witness line. Specify the value as 1 or 2 depending on which side of the dimension the witness line lies. Use the methods wfcDimLocation::GetFirstWitnessLineLocation or wfcDimLocation::GetSecondWitnessLineLocation to get the location of the witness line end points for a dimension.
Use the method wfcWDimension::ShowWitnessLine to show the erased witness line for the specified dimension.
Note
The methods wfcWDimension::EraseWitnessLine and wfcWDimension::ShowWitnessLine erase and show the witness lines of dimensions and reference dimensions, respectively. These methods work with both drawings and solids.
The method wfcWDimension::SetSignificantDigits sets the number of decimals digits that are significant for a dimension or tolerance. If you specify the input argument Tolerance as false, the method sets the number of decimal places for a decimal dimension.
•  If the number of decimal places required to display the stored value of the dimension is greater than the number of decimal places specified in the method wfcWDimension::SetSignificantDigits and the round displayed value attribute of the dimension is ON, the stored value is unchanged. Only the displayed number of decimal places is changed and the displayed value is updated accordingly. For example, consider a dimension with its stored value as 12.12323 and the round displayed value attribute of the dimension is set to ON. If the method wfcWDimension::SetSignificantDigits sets the number of decimal places to 3, the stored value of the dimension is unchanged, that is, the stored value will be 12.12323. The displayed value of the dimension is rounded to 3 decimal places, that is, 12.123. The round displayed value attribute is not changed.
•  If the number of decimal places required to display the stored value of the dimension is greater than the number of decimal places specified in the method wfcWDimension::SetSignificantDigits and the round displayed value attribute of the dimension is OFF, the number of decimal places of the dimension is modified and the stored value is rounded to the specified number of decimal places. For example, consider a dimension with its stored value as 12.12323 and the round displayed value attribute of the dimension is OFF. If the method wfcWDimension::SetSignificantDigits sets the dimension to 3 decimal places, then the stored value of the dimension is rounded to 3 decimal places and is modified to 12.123. The dimension is displayed as 12.123.
•  If the number of decimal places required to display the stored value of the dimension is less than the number of decimal places specified in the method wfcWDimension::SetSignificantDigits, the number of decimal places is set to the specified value. The status of the round displayed value attribute is not considered, as no change or an increase to the number of decimal places will have no effect on the stored value. For example, consider a dimension with its stored value as 12.12323. If the method wfcWDimension::SetSignificantDigits sets the dimension to 8 decimal places and if trailing zeros are displayed, then the dimension is displayed as 12.12323000.
For a driven dimension:
•  If the number of decimal places set by the method is greater than or equal to the number of decimal places required to display the stored value of the dimension, the decimal places value is changed and no change to the round displayed value attribute is made.
•  If the number of decimal places of the dimension is less than the number required to display the stored value of the dimension, the round displayed value attribute is automatically set to ON as it is not possible to change the stored value of a driven dimension.
If you want to set the number of decimal places shown for the upper and lower values of the dimension tolerance, specify the input argument Tolerance as true. Thus, the decimals of the dimension tolerance can be set independent of the number of dimension decimals. By default, the number of decimal places for tolerance values is calculated based upon the “linear_tol” settings of the model.
Note
Specify a non-negative number as input for the argument Digits in the method wfcWDimension::SetSignificantDigits. It should be such that when you apply either the upper or lower values of tolerance to the given dimension, the total number of digits before and after the decimal point in the resulting values must not exceed 13.
The method wfcWDimension::SetDenominator sets the denominator for fractional dimensions and tolerances. If you specify the input argument Tolerance as false, the method sets the denominator for fractional dimensions. When you call the method wfcWDimension::SetDenominator:
•  The stored value remains unchanged if,
  it can be expressed as an exact fraction with the given denominator, regardless of whether the round-off attribute is set or not.
  the stored value cannot be expressed as an exact fraction, but the round-off attribute is set. In this case, the fraction is the approximate representation of the stored value.
•  The stored value changes to the nearest fraction and triggers a regeneration of the model, if it cannot be expressed as an exact fraction with the given denominator and the round-off attribute is not set.
If you want to set the value for the largest possible denominator for the upper and lower tolerance values, specify the input argument Tolerance as true. By default, this value is defined by the config.pro option, dim_fraction_denominator.
Use the method wfcWDimension::SetDimensionArrowType to set the style for the arrow head of a leader for a specified dimension. The input arguments are:
•  ArrowIndex—Specifies the index of the witness line. Depending on which side of the dimension the witness line lies, specify the value as 1 or 2. For diameter dimensions, this value determines which of the two arrows to change. For other dimensions, the value of 1 indicates the arrow on the first witness line, and the value of 2 indicates the arrow on the second witness line. For ordinate and radius dimensions, this value is ignored. Use the method wfcDimLocation::GetFirstWitnessLineLocation or wfcDimLocation::GetSecondWitnessLineLocation to get the location of the witness line end points for a dimension.
•  ArrowType—Specifies the type of arrow head using the enumerated data type wfcLeaderArrowType.
•  Drawing—Optional argument. Specifies the name of the drawing. For dimensions created in drawing mode and owned by a solid, which can be displayed only in the context of that drawing, specify the name of the drawing in the input argument drawing.
The function wfcWDimension::GetEnvelope returns the envelope of a line in the specified dimension. While retrieving coordinates of the dimension in a specified solid, if the dimension is displayed in the solid as well as in the drawing, the drawing must not be active. The input arguments follow:
•  drawing—The value for this input argument must be passed only if the solid dimension is shown in the drawing. Else, pass it as NULL.
•  line—The line number of the dimension.
Cleaning Up Dimensions
You can clean up the placement of dimensions in a drawing to meet the industry standards, and enable easier reading of your model detailing. You can adjust the location and display of dimensions by setting controls on the placement of a dimension. You can also set the cosmetic attributes, like flip the direction of arrow when the arrows do not fit between the witness lines and center the dimension text between two witness lines.
Methods Introduced:
Use the method wfcWDrawing::CleanupDimensions to clean up the dimensions in a drawing. The input argument is:
•  View—Specifies the view in which the dimensions must be cleaned as a pfcView2D object. If you pass the value as NULL, the dimensions are cleaned for all the views in the specified drawing.
The dimensions are cleaned using the default values set in the Clean Dimensions dialog box in Creo Parametric user interface.
Dimension Tolerances
Methods Introduced:
Only true dimension objects can have geometric tolerances.
The methods pfcDimension::GetTolerance and pfcDimension::SetTolerance enable you to access the dimension tolerance. The object types for the dimension tolerance are:
•  pfcDimTolLimits—Displays dimension tolerances as upper and lower limits.
Note
This format is not available when only the tolerance value for a dimension is displayed.
•  pfcDimTolPlusMinus—Displays dimensions as nominal with plus-minus tolerances. The positive and negative values are independent.
•  pfcDimTolSymmetric—Displays dimensions as nominal with a single value for both the positive and the negative tolerance.
•  pfcDimTolSymSuperscript—Displays dimensions as nominal with a single value for positive and negative tolerance. The text of the tolerance is displayed in a superscript format with respect to the dimension text.
•  pfcDimTolISODIN—Displays the tolerance table type, table column, and table name, if the dimension tolerance is set to a hole or shaft table (DIN/ISO standard).
A null value is similar to the nominal option in Creo Parametric.
To determine whether a given tolerance is plus/minus, symmetric, limits, or superscript use the method pfcDimTolerance::GetType.
The method wfcWSolid::GetTolerance returns the tolerance value for the specified solid. The input arguments are:
•  Type—Specifies the type of tolerance as linear or angular using the enumerated type wfcToleranceType.
•  Decimals—Specifies the number of decimal places to identify the tolerance value.
Use the method wfcWSolid::SetTolerance to set the geometric tolerance for the solid. Specify the tolerance type, number of decimal places for the tolerance value, and the tolerance value as the input arguments.
The method wfcWSession::GetDefaultTolerance returns the default value for the specified linear or angular tolerance value. The default value is set in the Creo Parametric configuration files. Specify the tolerance type and number of decimal places to identify the tolerance value as the input arguments.
All the user specified information for a tolerance is saved in a tolerance table for ISO and DIN standards. You can retrieve and set the data for tolerance tables using Creo Object TOOLKIT C++ methods. A model with ISO or DIN standard has an extra attribute called the tolerance class which determines the general coarseness of the model. The method wfcWSolid::GetModelClass returns the type of coarseness in a model using the enumerated type wfcModelClass. The valid values are:
•  wfcMODELCLASS_NONE
•  wfcMODELCLASS_FINE
•  wfcMODELCLASS_MEDIUM
•  wfcMODELCLASS_COARSE
•  wfcMODELCLASS_VERY_COARSE
Use the method wfcWSolid::SetModelClass to set the tolerance class for a solid.
The method wfcWSolid::LoadToleranceClass loads the hole or shaft tolerance table for a model with ISO or DIN standard in the current session. Pass the tolerance table name ToleranceClassName as the input argument.
The method wfcWDimension::IsToleranceDisplayed checks whether the tolerances of the specified dimension are currently displayed. Refer to the Creo Parametric Detailed Drawings Help for more information.
If the round off attribute for the given dimension is set, the methods wfcWDimension::GetDisplayedUpperLimitTolerance and wfcWDimension::GetDisplayedLowerLimitTolerance retrieve the displayed rounded values of the upper and lower limits of the specified dimension. Otherwise, it retrieves the stored values of the tolerances as done by the method wfcWSolid::GetTolerance. For example, consider a dimension that is set to round off to two decimal places and has the upper and lower tolerances 0.123456. By default, the tolerance values displayed are also rounded off to two decimal places. In this case, the methods wfcWDimension::GetDisplayedUpperLimitTolerance and wfcWDimension::GetDisplayedLowerLimitTolerance retrieve the upper and lower values as 0.12.
Dimension Prefix and Suffix
Methods Introduced:
The method wfcWDimension::GetPrefix retrieves the prefix assigned to the specified dimension.
Use the method wfcWDimension::SetPrefix to set the specified prefix for a dimension.
The method wfcWDimension::GetSuffix retrieves the suffix assigned to the specified dimension.
Use the method wfcWDimension::SetSuffix to set the specified suffix for a dimension.
Dimension Location
The methods described in this section extract the dimension location and geometry in 3D space for solid model dimensions.
Dimension Entity Location
The following methods extract the locations of geometric endpoints for the dimension. You can calculate the dimension location plane, witness line, and dimension orientation vectors from these points. The location of the points is specified in the same coordinate system as the solid model.
Methods Introduced:
The method wfcDimLocation::GetNormal returns the vector normal to the dimensioning plane for a radial or diameter dimension. This normal vector should correspond to the axis normal to the arc being measured by the radial or diameter dimension.
The method wfcDimLocation::GetCenterLeaderInformation obtains the information about the center leader as a wfcCenterLeaderInformation object. The type of center leader is determined by the orientation of the dimension text.
Use the method wfcCenterLeaderInformation::GetCenterLeaderType to get the type of center leader. The valid values are defined in the enumerated data type wfcDimCenterLeaderType:
•  wfcDIM_CLEADER_CENTERED_ELBOW—Specifies that the dimension text is placed next to and centered about the elbow of the center leader.
•  wfcDIM_CLEADER_ABOVE_ELBOW—Specifies that the dimension text is placed next to and above the elbow of the center leader.
•  wfcDIM_CLEADER_ABOVE_EXT_ELBOW—Specifies that the dimension text is placed above the extended elbow of the center leader.
•  wfcDIM_PARALLEL_ABOVE—Specifies that the dimension text is placed parallel to and above the center leader.
•  wfcDIM_PARALLEL_BELOW—Specifies that the dimension text is placed parallel to and below the center leader.
The method wfcCenterLeaderInformation::GetElbowLength and wfcCenterLeaderInformation::GetElbowDirection returns the length and direction of the elbow used by the center leader and the leader end symbol.
The method wfcCenterLeaderInformation::GetLeaderArrowType returns the type of arrow for the leader.
Note
A center leader type is available only for linear and diameter dimensions.
The methods wfcDimLocation::GetFirstZExtensionLineLocation and wfcDimLocation::GetSecondZExtensionLineLocation obtains the endpoints of the first and second Z-extension lines created for a specified dimension. Z-extension lines are automatically created whenever the dimension’s attachment does not intersect its reference in the Z-Direction. The Z-extension line is attached at the edge of the surface at the closest distance from the dimension witness line.
The methods wfcDimLocation::GetFirstArrowheadLocation and wfcDimLocation::GetSecondArrowheadLocation returns the location of the first and second arrow heads for a dimension.
The method wfcDimLocation::GetElbowLength returns the length of the elbow for a dimension.
The methods wfcDimLocation::GetFirstWitnessLineLocation and wfcDimLocation::GetSecondWitnessLineLocation gets the location of the first and second witness line end points for a dimension.
The method wfcDimLocation::GetLocation returns the location of the elements that make up a solid dimension or reference dimension.
The method wfcDimLocation::HasElbow specifies if a dimension has an elbow. The method returns the following values:
•  True—If the dimension has an elbow.
•  False—If the dimension does not have an elbow.
Dimension Orientation
Methods Introduced:
The method wfcWDimension::SetAnnotationPlane assigns an annotation plane as the orientation of a specified dimension stored in an annotation element.
The method wfcWDimension::GetAnnotationPlane obtains the orientation of a specified dimension stored in an annotation element.
Driving Dimension Annotation Elements
You can convert driving dimensions created by features into annotation elements and place them on annotation planes. However, you can create the driving dimension annotation elements only in the features that own the dimensions. These annotation elements cannot have any user defined or system references.
Methods Introduced:
The method wfcWDimension::CreateAnnotationElement creates an annotation element for a specified driving dimension based on the specified annotation orientation.
The method wfcWDimension::DeleteAnnotationElement removes the annotation element containing the driving dimension. It deletes all the parameters and relations associated with the annotation element.
Accessing Reference and Driven Dimensions
The methods described in this section provide additional access to reference and driven dimension annotations.
Many methods listed in the previous sections that are applicable for driving dimensions are also applicable for reference and driven dimensions.
Methods Introduced:
The method wfcWDimension::CanRegenerate identifies if a driven dimension can be regenerated.
The method wfcWDimension::Delete deletes the driven or reference dimension. Dimensions stored in annotation elements should be deleted using wfcWSelection::DeleteAnnotationElement.
The method wfcWDimension::IsDriving determines if a dimension is driving geometry or is driven by it. If a dimension drives geometry, its value can be modified and the model regenerated with the given change. If a dimension is driven by geometry, its value is fixed but it can be deleted and redefined as necessary. A driven dimension may also be included in an annotation element.
The method wfcWDimension::GetDimensionAttachPoints gets the entities to which a dimension is attached. This method supports dimensions that are created with intersection type of reference.
The method wfcWDimension::GetDimensionSenses gets information on how dimensions attach to the entity, that is, to what part of the entity and in what direction the dimension runs. The method returns a pfcDimSenses object for the driven or reference dimension. This method supports dimensions that are created with intersection type of reference. Refer to the section Creating Drawing Dimensions for more information.
The method wfcWDimension::GetOrientationHint gets the orientation of the driven or reference dimensions in cases where this cannot be deduced from the attachments themselves. This method supports dimensions that are created with intersection type of reference. The orientation of the dimension is given by the enumerated type pfcDimOrientationHint. The valid values are:
•  pfcORIENTATION_HINT_HORIZONTAL—Specifies a horizontal dimension.
•  pfcORIENTATION_HINT_VERTICAL—Specifies a vertical dimension.
•  pfcORIENTATION_HINT_SLANTED—Specifies the shortest distance between two attachment points (available only when the dimension is attached to points).
•  pfcORIENTATION_HINT_ELLIPSE_RADIUS1—Specifies the start radius for a dimension on an ellipse.
•  pfcORIENTATION_HINT_ELLIPSE_RADIUS2—Specifies the end radius for a dimension on an ellipse.
•  pfcORIENTATION_HINT_ARC_ANGLE—Specifies the angle of the arc for a dimension of an arc.
•  pfcORIENTATION_HINT_ARC_LENGTH—Specifies the length of the arc for a dimension of an arc.
•  pfcORIENTATION_HINT_LINE_TO_TANGENT_CURVE_ANGLE—Specifies the value to dimension the angle between the line and the tangent at a curve point (the point on the curve must be an endpoint).
•  pfcORIENTATION_HINT_RADIAL_DIFF—Specifies the linear dimension of the radial distance between two concentric arcs or circles.
The method wfcWDimension::SetDimensionAttachPoints sets the geometric references and parameters of the driven or reference dimension. This method supports dimensions that are created with intersection type of reference. The input arguments are:
•  DimAttachments—Specifies the points on the model where you want to attach the dimension.
•  DimSenses—Specifies how the dimension attaches to each attachment point of the model, that is, to what part of the entity.
•  OrientHint—Specifies the orientation of the dimension and has one of the values given by the enumerated type pfcDimOrientationHint.
•  AnnotPlane—Specifies the annotation plane for the dimensions.
45 Degree Chamfer Dimensions
You can create 45-degree chamfer dimensions by referencing one of the following items:
•  Edges, including solid or surface edges, silhouette edges, curves, and sketches.
•  Surfaces
•  Revolve surfaces
The methods described in this section provide access to the display style of 45- degree chamfer dimensions in a solid. These methods can also be used to access the display style of the chamfer dimension in a drawing, where the dimension is created in a solid and is displayed in a drawing. To work with dimensions shown in a drawing, pass the name of the drawing in the input argument drawing in the methods.
Note
The default display of a 45-degree chamfer dimension depends upon the setting of the config.pro option, default_chamfer_text.
Methods Introduced:
The methods wfcWDimension::GetChamferLeaderStyle and wfcWDimension::SetChamferLeaderStyle retrieve and set the style of the leader for the specified 45-degree chamfer dimension using the enumerated type wfcDimChamferLeaderStyle. The valid values are as follows:
•  wfcDIM_CHMFR_LEADER_STYLE_NORMAL—Defines the leader of the chamfer dimension normal to the chamfer edge (ASME, ANSI, JIS, ISO Standard).
•  wfcDIM_CHMFR_LEADER_STYLE_DEFAULT—Defines that the chamfer dimension leader style should be displayed using the default value.
The methods wfcWDimension::GetConfiguration and wfcWDimension::SetConfiguration retrieve and set the dimension configuration for chamfer dimensions using the enumerated type wfcDimLeaderConfig. The dimension configuration defines the style in which the dimension must be displayed. The valid values are as follows:
•  wfcDIMCONFIG_LEADER—Creates the dimension with a leader.
•  wfcDIMCONFIG_LINEAR—Creates a linear dimension.
•  wfcDIMCONFIG_CENTER_LEADER—Creates the dimension with the leader note attached to the center of the dimension leader line.
The methods wfcWDimension::GetChamferStyle and wfcWDimension::SetChamferStyle retrieve and set the dimension scheme for the specified 45-degree chamfer dimension using the enumerated type wfcDimChamferStyle. The valid values are as follows:
•  wfcDIM_CHMFRSTYLE_CD—Specifies that the chamfer dimension text should be displayed in the C(Dimension value) format (JIS/GB Standard).
•  wfcDIM_CHMFRSTYLE_D_X_45—Specifies that the chamfer dimension text should be displayed in the (Dimension value) X 45 format (ISO/DIN Standards).
•  wfcDIM_CHMFRSTYLE_DEFAULT—Specifies that the chamfer dimension text should be displayed using the default value set in the drawing detail option default_chamfer_text.
•  wfcDIM_CHMFRSTYLE_45_X_D—Specifies that the chamfer dimension text should be displayed in the 45 X (Dimension value) format (ASME/ANSI Standards).