Functions Introduced:
Creo Parametric supports hatch pattern files of the *.pat file format. The new hatch supports nonlinear hatching styles.
The old hatch uses the Xhatch *.xch file format. It is recommended to use the *.pat files. Refer to the Creo Parametric Online Help for more information.
The function ProXsecCompXhatchGet() returns the line patterns of a cross section component based on the specified cross section handle and the ID of the cross
section component. The line patterns obtained are ProXsecXhatch structures that contain the following fields:
|
• |
angle—Specifies the angle of the line patterns. |
|
• |
spacing—Specifies the distance between the line patterns. |
|
• |
offset—Specifies the offset of the first line in the pattern. |
Note
The functions ProXsecCompXhatchGet(), ProXsecCompXhatchAdd(), and ProXsecCompXhatchReplace() support only the old hatching styles, that is, the *.xch file format.
The function ProXsecCompXhatchAdd() adds a line pattern to a specified cross section component. This function takes the handle to the cross section, the ID of
the cross section component, the handle to the drawing view containing the cross section component and a pointer to the ProXsecXhatch object as its input arguments.
Note
If the cross section component already includes a line pattern, then the function ProXsecCompXhatchAdd() does not add a line pattern.
The function ProXsecCompXhatchReplace() replaces all existing line patterns of a specified cross section component with a new one.
The function
ProXsecCompXhatchStyleGet() returns information about the style of hatch pattern in the specified cross section component. The output argument
p_xhatch_style returns a
ProXsecXhatchStyle handle. The structure
ProXsecXhatchStyle contains the following information:
|
• |
type—Specifies the type of hatch. The valid values are:
|
○
|
PRO_XHATCH—Specifies that the cross section component is displayed as a hatch. |
|
○
|
PRO_XSEC_EXCLUDED—Specifies that the cross section is excluded for the specified assembly component. |
|
○
|
PRO_XSEC_FILL—Specifies that the cross section component is displayed as a solid. |
|
○
|
PRO_XHATCH_ERASED—Specifies that the cross section component is erased, that is, neither hatched nor filled. |
|
|
• |
ProXsecXhatchPattern—Specifies a structure that contains information about the hatch pattern in a cross section. It contains the following information:
|
○
|
angle—Specifies the angle of the lines in the patterns. |
|
○
|
spacing—Specifies the distance between the lines in the patterns. |
|
○
|
offset—Specifies the offset of the first line in the pattern. |
|
○
|
font—Specifies a line style for the line pattern. |
|
○
|
color—Specifies the color for the line pattern. |
|
Note
The functions ProXsecCompXhatchGet() and ProXsecCompXhatchStyleSet() support only the old hatching styles, that is, the *.xch file format.
The function ProXsecCompXhatchStyleSet() sets the hatch pattern for the specified cross section component using the ProXsecXhatchStyle structure.
The function
ProXsecCompNewXhatchStyleGet() returns information about the style of old and new, that is, nonlinear hatch pattern in the specified cross section component.
The output argument
p_xhatch_style returns a
ProXsecNewXhatchStyle handle. The structure
ProXsecNewXhatchStyle contains the following information:
|
• |
type—Specifies the type of hatch. The valid values are:
|
○
|
PRO_XHATCH—Specifies that the cross section component is displayed as a hatch. |
|
○
|
PRO_XSEC_EXCLUDED—Specifies that the cross section is excluded for the specified assembly component. |
|
○
|
PRO_XSEC_FILL—Specifies that the cross section component is displayed as a solid. |
|
○
|
PRO_XHATCH_ERASED—Specifies that the cross section component is erased, that is, neither hatched nor filled. |
|
|
• |
ProXsecXhatchPattern—Specifies a structure that contains information about the old hatch pattern in a cross section. It contains the following
information:
|
○
|
angle—Specifies the angle of the lines in the patterns. |
|
○
|
spacing—Specifies the distance between the lines in the patterns. |
|
○
|
offset—Specifies the offset of the first line in the pattern. |
|
○
|
font—Specifies a line style for the line pattern. |
|
○
|
color—Specifies the color for the line pattern. |
Note
When the cross section has old hatch patterns, the field *new_lines in the structure ProXsecNewXhatchStyle is returned as NULL.
|
|
• |
ProXsecNewXhatchPattern—Specifies a structure that contains information about the new hatch pattern in a cross section. It contains the following
information:
|
○
|
angle—Specifies the angle of the lines in the patterns. |
|
○
|
x_origin—Specifies the origin of the first pattern line along the x-axis. |
|
○
|
y_origin—Specifies the origin of the first pattern line along the y-axis. |
|
○
|
delta_x—This is used for dashed line pattern. Specifies the distance after which the next dashed line starts in a pattern. |
|
○
|
delta_y—This is used for both continuous and dashed line pattern. Specifies the distance between the pattern lines. |
|
○
|
dash—Specifies a dashed line pattern. |
|
○
|
num_dash—Specifies the number of dashes for the line pattern. |
|
○
|
color—Specifies the color for the line pattern. |
Note
When the cross section has new hatch patterns, the field *old_lines in the structure ProXsecNewXhatchStyle is returned as NULL.
|
The function
ProXsecCompNewXhatchStyleSet() sets the hatch pattern for the specified cross section component using the
ProXsecNewXhatchStyle structure.
Note
When you set new hatch patterns for the cross section, pass the field *old_lines as NULL in the structure ProXsecNewXhatchStyle. Similarly, when you set old hatch patterns for a cross section, pass the field *new_lines as NULL in the structure ProXsecNewXhatchStyle.
Use the function ProXsecCompNewXhatchStyleSetByName() to replace an existing hatch pattern with the specified hatch pattern. This function supports only new, that is, nonlinear
hatch patterns. For the replacing hatch pattern, you can also set the type and color attributes.