SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
styles.h File Reference
#include <SketchUpAPI/common.h>
#include <SketchUpAPI/geometry.h>
#include <SketchUpAPI/model/defs.h>

Go to the source code of this file.

Functions

SU_RESULT 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...
 
SU_RESULT SUStylesGetNumStyles (SUStylesRef styles, size_t *count)
 Retrieves the number of styles in a styles object. More...
 
SU_RESULT SUStylesGetStyles (SUStylesRef styles, size_t len, SUStyleRef style_array[], size_t *count)
 Retrieves all the styles associated with a styles object. More...
 
SU_RESULT SUStylesGetActiveStyle (SUStylesRef styles, SUStyleRef *style)
 Retrieves the active style. More...
 
SU_RESULT SUStylesGetSelectedStyle (SUStylesRef styles, SUStyleRef *style)
 Retrieves the selected style. More...
 
SU_RESULT SUStylesGetStyleByGuid (SUStylesRef styles, const char *guid, SUStyleRef *style)
 Retrieves the style corresponding to the specified Guid. More...
 
SU_RESULT SUStylesGetStyleByPath (SUStylesRef styles, const char *path, SUStyleRef *style)
 Retrieves the style corresponding to the specified path. More...
 
SU_RESULT SUStylesGetActiveStyleChanged (SUStylesRef styles, bool *changed)
 Retrieves a bolean indicating if the active style has changed. More...
 
SU_RESULT SUStylesApplyStyleToScene (SUStylesRef styles, SUStyleRef style, SUSceneRef scene)
 Applies the specified style to the specified scene. More...
 
SU_RESULT SUStylesSetSelectedStyle (SUStylesRef styles, SUStyleRef style)
 Sets the selected style. More...
 
SU_RESULT 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...
 

Function Documentation

SU_RESULT 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.

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
SU_RESULT SUStylesApplyStyleToScene ( SUStylesRef  styles,
SUStyleRef  style,
SUSceneRef  scene 
)

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
SU_RESULT SUStylesGetActiveStyle ( SUStylesRef  styles,
SUStyleRef style 
)

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
SU_RESULT SUStylesGetActiveStyleChanged ( SUStylesRef  styles,
bool *  changed 
)

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
SU_RESULT SUStylesGetNumStyles ( SUStylesRef  styles,
size_t *  count 
)

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
SU_RESULT SUStylesGetSelectedStyle ( SUStylesRef  styles,
SUStyleRef style 
)

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
SU_RESULT SUStylesGetStyleByGuid ( SUStylesRef  styles,
const char *  guid,
SUStyleRef style 
)

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
SU_RESULT SUStylesGetStyleByPath ( SUStylesRef  styles,
const char *  path,
SUStyleRef style 
)

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
SU_RESULT SUStylesGetStyles ( SUStylesRef  styles,
size_t  len,
SUStyleRef  style_array[],
size_t *  count 
)

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
SU_RESULT 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.

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

Sets the selected style.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]stylesThe styles object.
[in]styleThe style object.
Returns