SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Related Functions
SUHatchPatternRef Struct Reference

References a hatch pattern used for section-fill rendering in SketchUp models. More...

#include <SketchUpAPI/model/hatch_pattern.h>

Related Functions

(Note that these are not member functions.)

SUEntityRef SUHatchPatternToEntity (SUHatchPatternRef hatch_pattern)
 Converts from an SUHatchPatternRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SUHatchPatternRef SUHatchPatternFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUHatchPatternRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUHatchPatternRef. More...
 
enum SUResult SUHatchPatternCreate (SUHatchPatternRef *hatch_pattern)
 Creates a new empty hatch pattern object. More...
 
enum SUResult SUHatchPatternCreateFromFile (SUHatchPatternRef *hatch_pattern, const char *file_name)
 Creates a hatch pattern object from a .skh file. More...
 
enum SUResult SUHatchPatternRelease (SUHatchPatternRef *hatch_pattern)
 Releases a hatch pattern object that has not been added to a model. More...
 
enum SUResult SUHatchPatternGetName (SUHatchPatternRef hatch_pattern, SUStringRef *name)
 Retrieves the name of a hatch pattern object. More...
 
enum SUResult SUHatchPatternSetName (SUHatchPatternRef hatch_pattern, const char *name)
 Sets the name of a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetData (SUHatchPatternRef hatch_pattern, SUHatchPatternDataRef *hatch_pattern_data)
 Retrieves the fill properties of a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetFillColor (SUHatchPatternRef hatch_pattern, SUColor *color)
 Retrieves the solid fill color of a hatch pattern object. More...
 
enum SUResult SUHatchPatternSetFillColor (SUHatchPatternRef hatch_pattern, const SUColor *color)
 Sets the solid fill color of a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetFillTextureImage (SUHatchPatternRef hatch_pattern, SUImageRepRef *image)
 Retrieves the fill texture image of a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetFillTextureFileName (SUHatchPatternRef hatch_pattern, SUStringRef *file_name)
 Retrieves the file name that the fill texture image of a hatch pattern was loaded from. More...
 
enum SUResult SUHatchPatternSetFillTextureImageAndFileName (SUHatchPatternRef hatch_pattern, SUImageRepRef image, const char *file_name)
 Sets the fill texture image of a hatch pattern object along with the file name it came from. More...
 
enum SUResult SUHatchPatternClearFillTexture (SUHatchPatternRef hatch_pattern)
 Removes the fill texture image from a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetUVScale (SUHatchPatternRef hatch_pattern, float *u_scale, float *v_scale)
 Retrieves the UV scale of a hatch pattern object. More...
 
enum SUResult SUHatchPatternSetUVScale (SUHatchPatternRef hatch_pattern, float u_scale, float v_scale)
 Sets the UV scale of a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetRotationAngle (SUHatchPatternRef hatch_pattern, float *angle)
 Retrieves the rotation angle of a hatch pattern object, in degrees. More...
 
enum SUResult SUHatchPatternSetRotationAngle (SUHatchPatternRef hatch_pattern, float angle)
 Sets the rotation angle of a hatch pattern object, in degrees. More...
 
enum SUResult SUHatchPatternGetFillPatternFileName (SUHatchPatternRef hatch_pattern, SUStringRef *file_name)
 Retrieves the file name that the .pat line-pattern definition of a hatch pattern was loaded from. More...
 
enum SUResult SUHatchPatternSetFillPatternFromFile (SUHatchPatternRef hatch_pattern, const char *file_name)
 Loads the .pat line-pattern definition of a hatch pattern object from a file. More...
 
enum SUResult SUHatchPatternSaveFillPatternToFile (SUHatchPatternRef hatch_pattern, const char *file_name)
 Writes the .pat line-pattern definition of a hatch pattern object to a file. More...
 
enum SUResult SUHatchPatternClearFillPattern (SUHatchPatternRef hatch_pattern)
 Removes the .pat line-pattern definition from a hatch pattern object. More...
 
enum SUResult SUHatchPatternGetThumbnailImage (SUHatchPatternRef hatch_pattern, SUImageRepRef *image)
 Retrieves the thumbnail preview image of a hatch pattern object. More...
 
enum SUResult SUHatchPatternWriteToFile (SUHatchPatternRef hatch_pattern, const char *file_name)
 Writes a hatch pattern object to a .skh file. More...
 

Detailed Description

References a hatch pattern used for section-fill rendering in SketchUp models.

Since
SketchUp 2027.0, API 15.0

Friends And Related Function Documentation

enum SUResult SUHatchPatternClearFillPattern ( SUHatchPatternRef  hatch_pattern)
related

Removes the .pat line-pattern definition from a hatch pattern object.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
Returns
enum SUResult SUHatchPatternClearFillTexture ( SUHatchPatternRef  hatch_pattern)
related

Removes the fill texture image from a hatch pattern object.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
Returns
enum SUResult SUHatchPatternCreate ( SUHatchPatternRef *  hatch_pattern)
related

Creates a new empty hatch pattern object.

The created hatch pattern is not owned by any model. Either add it to a model's hatch patterns collection with SUHatchPatternsAdd(), which transfers ownership, or release it with SUHatchPatternRelease().

Since
SketchUp 2027.0, API 15.0
Parameters
[out]hatch_patternThe hatch pattern object created.
Returns
enum SUResult SUHatchPatternCreateFromFile ( SUHatchPatternRef *  hatch_pattern,
const char *  file_name 
)
related

Creates a hatch pattern object from a .skh file.

The created hatch pattern is not owned by any model. Either add it to a model's hatch patterns collection with SUHatchPatternsAdd(), which transfers ownership, or release it with SUHatchPatternRelease().

Since
SketchUp 2027.0, API 15.0
Parameters
[out]hatch_patternThe hatch pattern object created.
[in]file_nameThe path of the .skh file to load. Assumed to be UTF-8 encoded.
Returns
SUHatchPatternRef SUHatchPatternFromEntity ( SUEntityRef  entity)
related

Converts from an SUEntityRef to an SUHatchPatternRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUHatchPatternRef.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUHatchPatternRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
enum SUResult SUHatchPatternGetData ( SUHatchPatternRef  hatch_pattern,
SUHatchPatternDataRef *  hatch_pattern_data 
)
related

Retrieves the fill properties of a hatch pattern object.

See Also
SURenderingOptionsSetHatchPattern()
Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]hatch_pattern_dataThe fill properties retrieved.
Returns
enum SUResult SUHatchPatternGetFillColor ( SUHatchPatternRef  hatch_pattern,
SUColor *  color 
)
related

Retrieves the solid fill color of a hatch pattern object.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]colorThe color retrieved.
Returns
enum SUResult SUHatchPatternGetFillPatternFileName ( SUHatchPatternRef  hatch_pattern,
SUStringRef *  file_name 
)
related

Retrieves the file name that the .pat line-pattern definition of a hatch pattern was loaded from.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]file_nameThe file name retrieved. Empty if no definition has been set.
Returns
enum SUResult SUHatchPatternGetFillTextureFileName ( SUHatchPatternRef  hatch_pattern,
SUStringRef *  file_name 
)
related

Retrieves the file name that the fill texture image of a hatch pattern was loaded from.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]file_nameThe file name retrieved. Empty if no texture has been set.
Returns
enum SUResult SUHatchPatternGetFillTextureImage ( SUHatchPatternRef  hatch_pattern,
SUImageRepRef *  image 
)
related

Retrieves the fill texture image of a hatch pattern object.

image must refer to a valid SUImageRepRef object. The image data is copied into it.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]imageThe image retrieved.
Returns
enum SUResult SUHatchPatternGetName ( SUHatchPatternRef  hatch_pattern,
SUStringRef *  name 
)
related

Retrieves the name of a hatch pattern object.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]nameThe name retrieved.
Returns
enum SUResult SUHatchPatternGetRotationAngle ( SUHatchPatternRef  hatch_pattern,
float *  angle 
)
related

Retrieves the rotation angle of a hatch pattern object, in degrees.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]angleThe angle retrieved, in degrees.
Returns
enum SUResult SUHatchPatternGetThumbnailImage ( SUHatchPatternRef  hatch_pattern,
SUImageRepRef *  image 
)
related

Retrieves the thumbnail preview image of a hatch pattern object.

The thumbnail is generated from the hatch pattern's own properties, so it is read only. image must refer to a valid SUImageRepRef object created with SUImageRepCreate(); the image data is copied into it.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]imageThe image retrieved.
Returns
enum SUResult SUHatchPatternGetUVScale ( SUHatchPatternRef  hatch_pattern,
float *  u_scale,
float *  v_scale 
)
related

Retrieves the UV scale of a hatch pattern object.

Both values are scale factors applied to the pattern's repeat.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[out]u_scaleThe scale along the u axis.
[out]v_scaleThe scale along the v axis.
Returns
enum SUResult SUHatchPatternRelease ( SUHatchPatternRef *  hatch_pattern)
related

Releases a hatch pattern object that has not been added to a model.

Only call this on a hatch pattern that SUHatchPatternsAdd() has not taken ownership of. hatch_pattern is set to invalid by this function.

Since
SketchUp 2027.0, API 15.0
Parameters
[in,out]hatch_patternThe hatch pattern object.
Returns
enum SUResult SUHatchPatternSaveFillPatternToFile ( SUHatchPatternRef  hatch_pattern,
const char *  file_name 
)
related

Writes the .pat line-pattern definition of a hatch pattern object to a file.

This writes only the line-pattern definition. To write the whole hatch pattern, use SUHatchPatternWriteToFile().

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]file_nameThe path of the .pat file to write. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUHatchPatternSetFillColor ( SUHatchPatternRef  hatch_pattern,
const SUColor *  color 
)
related

Sets the solid fill color of a hatch pattern object.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]colorThe color to set.
Returns
enum SUResult SUHatchPatternSetFillPatternFromFile ( SUHatchPatternRef  hatch_pattern,
const char *  file_name 
)
related

Loads the .pat line-pattern definition of a hatch pattern object from a file.

Since
SketchUp 2027.0, API 15.0
Note
A .pat file may hold more than one pattern definition. Only the first definition in the file is loaded; any others are ignored.
Parameters
[in]hatch_patternThe hatch pattern object.
[in]file_nameThe path of the .pat file to load. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUHatchPatternSetFillTextureImageAndFileName ( SUHatchPatternRef  hatch_pattern,
SUImageRepRef  image,
const char *  file_name 
)
related

Sets the fill texture image of a hatch pattern object along with the file name it came from.

The image and its source file name are a unit, so they are set together. file_name records where the image came from and may be empty for an image that has no file on disk.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]imageThe image to set.
[in]file_nameThe file name the image came from. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUHatchPatternSetName ( SUHatchPatternRef  hatch_pattern,
const char *  name 
)
related

Sets the name of a hatch pattern object.

The name must not be empty. Once the hatch pattern belongs to a model, the name must also be unique within that model; assigning a hatch pattern its own current name is allowed and does nothing.

See Also
SUHatchPatternsGetHatchPatternByName()
SUHatchPatternsAdd()
Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]nameThe name to set. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUHatchPatternSetRotationAngle ( SUHatchPatternRef  hatch_pattern,
float  angle 
)
related

Sets the rotation angle of a hatch pattern object, in degrees.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]angleThe angle to set, in degrees. Defaults to 0.
Returns
enum SUResult SUHatchPatternSetUVScale ( SUHatchPatternRef  hatch_pattern,
float  u_scale,
float  v_scale 
)
related

Sets the UV scale of a hatch pattern object.

Both values are scale factors applied to the pattern's repeat, and both must be positive.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]u_scaleThe scale to set along the u axis.
[in]v_scaleThe scale to set along the v axis.
Returns
SUEntityRef SUHatchPatternToEntity ( SUHatchPatternRef  hatch_pattern)
related

Converts from an SUHatchPatternRef to an SUEntityRef. This is essentially an upcast operation.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe given hatch pattern reference.
Returns
  • The converted SUEntityRef if hatch_pattern is a valid object
  • If not, the returned reference will be invalid
enum SUResult SUHatchPatternWriteToFile ( SUHatchPatternRef  hatch_pattern,
const char *  file_name 
)
related

Writes a hatch pattern object to a .skh file.

Since
SketchUp 2027.0, API 15.0
Parameters
[in]hatch_patternThe hatch pattern object.
[in]file_nameThe path of the .skh file to write. Assumed to be UTF-8 encoded.
Returns

The documentation for this struct was generated from the following files: