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

A styles entity reference. More...

#include <SketchUpAPI/model/styles.h>

Related Functions

(Note that these are not member functions.)

enum SUResult SUStyleCreate (SUStyleRef *style)
 Creates an empty style object. More...
 
enum SUResult SUStyleCreateFromFile (SUStyleRef *style, const char *path)
 Creates a style object from a file at the given path. More...
 
enum SUResult SUStyleRelease (SUStyleRef *style)
 Releases a style object. More...
 
SUEntityRef SUStyleToEntity (SUStyleRef style)
 Converts from an SUStyleRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SUStyleRef SUStyleFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUStyleRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUStyleRef. More...
 
enum SUResult SUStyleSetName (SUStyleRef style, const char *name)
 Sets the name of a style object. More...
 
enum SUResult SUStyleGetName (SUStyleRef style, SUStringRef *name)
 Retrieves the name of a style object. More...
 
enum SUResult SUStyleGetDisplayName (SUStyleRef style, SUStringRef *name)
 Retrieves the display name of a style object. If the name begins with a wildcard character "*" the wildcard will be replaced be a default string. The default string defaults to "*", so is no default string is set this function will always return the same string as GetName. More...
 
enum SUResult SUStyleSetDescription (SUStyleRef style, const char *description)
 Sets the description of a style object. More...
 
enum SUResult SUStyleGetDescription (SUStyleRef style, SUStringRef *description)
 Retrieves the description of a style object. More...
 
enum SUResult SUStyleGetPath (SUStyleRef style, SUStringRef *path)
 Retrieves the filepath to the file which was used to import this style. More...
 
enum SUResult SUStyleGetGuid (SUStyleRef style, SUStringRef *guid)
 Retrieves the GUID of a style object. More...
 
enum SUResult SUStyleGetDisplaysWatermark (SUStyleRef style, bool *shows_mark)
 Retrieves a boolean indicating whether the style displays a watermark. More...
 
enum SUResult SUStyleSaveToFile (SUStyleRef style, const char *path)
 Saves the style data to the specified path. More...
 
enum SUResult SUStyleSetProperty (SUStyleRef style, enum SUStylePropertyType type, SUTypedValueRef value)
 Sets the value of the specified SUStylePropertyType. More...
 
enum SUResult SUStyleGetProperty (SUStyleRef style, enum SUStylePropertyType type, SUTypedValueRef *value)
 Retrieves a SUTypedValueRef containing the value of the specified SUStylePropertyType. More...
 
enum SUResult SUStyleGetThumbnail (SUStyleRef style, SUImageRepRef *image)
 Retrieves an image containing the style's thumbnail. The given image representation object must have been constructed using SUImageRepCreate(). It must be released using SUImageRepRelease(). More...
 
enum SUResult SUStylesAddStyle (SUStylesRef styles, const char *path, bool activate)
 Adds a new style to the styles object from a file at the given path. Optionally will set the new style as the active style. More...
 
enum SUResult SUStylesGetNumStyles (SUStylesRef styles, size_t *count)
 Retrieves the number of styles in a styles object. More...
 
enum SUResult SUStylesGetStyles (SUStylesRef styles, size_t len, SUStyleRef style_array[], size_t *count)
 Retrieves all the styles associated with a styles object. More...
 
enum SUResult SUStylesGetActiveStyle (SUStylesRef styles, SUStyleRef *style)
 Retrieves the active style. More...
 
enum SUResult SUStylesGetSelectedStyle (SUStylesRef styles, SUStyleRef *style)
 Retrieves the selected style. More...
 
enum SUResult SUStylesGetStyleByGuid (SUStylesRef styles, const char *guid, SUStyleRef *style)
 Retrieves the style corresponding to the specified Guid. More...
 
enum SUResult SUStylesGetStyleByPath (SUStylesRef styles, const char *path, SUStyleRef *style)
 Retrieves the style corresponding to the specified path. More...
 
enum SUResult SUStylesGetActiveStyleChanged (SUStylesRef styles, bool *changed)
 Retrieves a bolean indicating if the active style has changed. More...
 
enum SUResult SUStylesApplyStyleToScene (SUStylesRef styles, SUStyleRef style, SUSceneRef scene)
 Applies the specified style to the specified scene. More...
 
enum SUResult SUStylesSetSelectedStyle (SUStylesRef styles, SUStyleRef style)
 Sets the selected style. More...
 
enum SUResult SUStylesRemoveStyle (SUStylesRef styles, SUStyleRef *style)
 Delete the selected style. The style will be removed from all scenes that use it and then released. The first different style in the style manager will replace the style on model pages. The manager must have at least one style remaining. More...
 

Detailed Description

A styles entity reference.

Since
SketchUp 2017, API 5.0

Friends And Related Function Documentation

enum SUResult SUStyleCreate ( SUStyleRef style)
related

Creates an empty style object.

Since
SketchUp 2017, API 5.0
Parameters
[out]styleThe style object.
Returns
enum SUResult SUStyleCreateFromFile ( SUStyleRef style,
const char *  path 
)
related

Creates a style object from a file at the given path.

Since
SketchUp 2017, API 5.0
Parameters
[out]styleThe style object.
[in]pathThe file path. Assumed to be UTF-8 encoded.
Returns
SUStyleRef SUStyleFromEntity ( SUEntityRef  entity)
related

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

Since
SketchUp 2017, API 5.0
Parameters
[in]entityThe entity object.
Returns
  • The converted SUStyleRef if the downcast operation succeeds
  • If the downcast operation fails, the returned reference will be invalid
enum SUResult SUStyleGetDescription ( SUStyleRef  style,
SUStringRef description 
)
related

Retrieves the description of a style object.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]descriptionThe description retrieved.
Returns
enum SUResult SUStyleGetDisplayName ( SUStyleRef  style,
SUStringRef name 
)
related

Retrieves the display name of a style object. If the name begins with a wildcard character "*" the wildcard will be replaced be a default string. The default string defaults to "*", so is no default string is set this function will always return the same string as GetName.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]nameThe display name retrieved.
Returns
enum SUResult SUStyleGetDisplaysWatermark ( SUStyleRef  style,
bool *  shows_mark 
)
related

Retrieves a boolean indicating whether the style displays a watermark.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]shows_markThe boolean retrieved.
Returns
enum SUResult SUStyleGetGuid ( SUStyleRef  style,
SUStringRef guid 
)
related

Retrieves the GUID of a style object.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]guidThe GUID retrieved.
Returns
enum SUResult SUStyleGetName ( SUStyleRef  style,
SUStringRef name 
)
related

Retrieves the name of a style object.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]nameThe name retrieved.
Returns
enum SUResult SUStyleGetPath ( SUStyleRef  style,
SUStringRef path 
)
related

Retrieves the filepath to the file which was used to import this style.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]pathThe path retrieved.
Returns
enum SUResult SUStyleGetProperty ( SUStyleRef  style,
enum SUStylePropertyType  type,
SUTypedValueRef value 
)
related

Retrieves a SUTypedValueRef containing the value of the specified SUStylePropertyType.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[in]typeThe style type to retrieve.
[out]valueThe SUTypedValueRef retrieved.
Returns
enum SUResult SUStyleGetThumbnail ( SUStyleRef  style,
SUImageRepRef image 
)
related

Retrieves an image containing the style's thumbnail. The given image representation object must have been constructed using SUImageRepCreate(). It must be released using SUImageRepRelease().

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[out]imageThe image object retrieved.
Returns
enum SUResult SUStyleRelease ( SUStyleRef style)
related

Releases a style object.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
Returns
enum SUResult SUStylesAddStyle ( SUStylesRef  styles,
const char *  path,
bool  activate 
)
related

Adds a new style to the styles object from a file at the given path. Optionally will set the new style as the active style.

NOTE: Return value SU_ERROR_SERIALIZATION was added for SketchUp 2019, API 7.0

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[in]pathThe string specifying the file path to the new style.
[in]activateIf true activate the style.
Returns
enum SUResult SUStylesApplyStyleToScene ( SUStylesRef  styles,
SUStyleRef  style,
SUSceneRef  scene 
)
related

Applies the specified style to the specified scene.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[in]styleThe style to be applied to a scene.
[in]sceneThe scene to which the style will be applied.
Returns
enum SUResult SUStyleSaveToFile ( SUStyleRef  style,
const char *  path 
)
related

Saves the style data to the specified path.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[in]pathThe path to where the data should be saved. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUStyleSetDescription ( SUStyleRef  style,
const char *  description 
)
related

Sets the description of a style object.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[in]descriptionThe description string to set the style object. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUStyleSetName ( SUStyleRef  style,
const char *  name 
)
related

Sets the name of a style object.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[in]nameThe name string to set the style object. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUStyleSetProperty ( SUStyleRef  style,
enum SUStylePropertyType  type,
SUTypedValueRef  value 
)
related

Sets the value of the specified SUStylePropertyType.

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
[in]typeThe style type to set.
[in]valueThe value to set for type.
Returns
enum SUResult SUStylesGetActiveStyle ( SUStylesRef  styles,
SUStyleRef style 
)
related

Retrieves the active style.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[out]stylePointer to a SUStyleRef for returning the style.
Returns
enum SUResult SUStylesGetActiveStyleChanged ( SUStylesRef  styles,
bool *  changed 
)
related

Retrieves a bolean indicating if the active style has changed.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[out]changedReturns true if the active style was changed.
Returns
enum SUResult SUStylesGetNumStyles ( SUStylesRef  styles,
size_t *  count 
)
related

Retrieves the number of styles in a styles object.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[out]countThe number of style objects available.
Returns
enum SUResult SUStylesGetSelectedStyle ( SUStylesRef  styles,
SUStyleRef style 
)
related

Retrieves the selected style.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[out]stylePointer to a SUStyleRef for returning the style.
Returns
enum SUResult SUStylesGetStyleByGuid ( SUStylesRef  styles,
const char *  guid,
SUStyleRef style 
)
related

Retrieves the style corresponding to the specified Guid.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[in]guidThe string specifying a style by Guid.
[out]stylePointer to a SUStyleRef for returning the style.
Returns
enum SUResult SUStylesGetStyleByPath ( SUStylesRef  styles,
const char *  path,
SUStyleRef style 
)
related

Retrieves the style corresponding to the specified path.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[in]pathThe string specifying a style by path.
[out]stylePointer to a SUStyleRef for returning the style.
Returns
enum SUResult SUStylesGetStyles ( SUStylesRef  styles,
size_t  len,
SUStyleRef  style_array[],
size_t *  count 
)
related

Retrieves all the styles associated with a styles object.

Since
SketchUp 2017, API 5.0
Parameters
[in]stylesThe styles object.
[in]lenThe number of style objects to retrieve.
[out]style_arrayThe style objects retrieved.
[out]countThe number of style objects retrieved.
Returns
enum SUResult SUStylesRemoveStyle ( SUStylesRef  styles,
SUStyleRef style 
)
related

Delete the selected style. The style will be removed from all scenes that use it and then released. The first different style in the style manager will replace the style on model pages. The manager must have at least one style remaining.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]stylesThe styles object.
[in,out]styleThe style object.
Returns
enum SUResult SUStylesSetSelectedStyle ( SUStylesRef  styles,
SUStyleRef  style 
)
related

Sets the selected style.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]stylesThe styles object.
[in]styleThe style object.
Returns
SUEntityRef SUStyleToEntity ( SUStyleRef  style)
related

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

Since
SketchUp 2017, API 5.0
Parameters
[in]styleThe style object.
Returns
  • The converted SUEntityRef if style is a valid object
  • If not, the returned reference will be invalid

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