Example of Entering and Displaying the Helix Constrain Type
This example demonstrates displaying and modifying the helix constrain type. The constrain type defines the
behavior of the spiral curve when the Total Height, Turn Height, or Turns properties are changed.
The AboutHelixConstrain() function requires a value of the OdDbHelix::ConstrainType enumerator and returns
a string containing the comment about the passed helix constrain type as an OdString value. The functions
declare a variable of the OdString type and use the format() method to convert the type number. Then this
function checks the passed type using the switch statement to select the comment which must be attached to
the resulting string.
The AboutHelixConstrain() function has the following implementation:
The EntryHelixConstrain() function requires a reference to a variable of a 16-bit Integer type in which the
selected helix constrain type must be saved as an argument; the function returns True if the user selects a type
or False if the user cancels entry. The function organizes a loop that displays the list of available constrain types, and then, inquires about the number as an Integer value. The constrain type can take the following
values: 0-kTurnHeight (Turn Height), 1-kTurns (Revolutions), 2-kHeight (Total Height). After entry, the function
checks whether the value is in the range [0 to 2]. If the entry is incorrect or out of range, the function displays
an error message and repeats the loop. If the entry is correct, the function returns True and
returns the selected type number through the argument in the calling function. If the user selects [3] or [6], the function
cancels entry and returns False as a resulting value.
The EntryHelixConstrain() function has the following implementation: