SketchUp C API

- Main Page
- Related Pages
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Related Functions
SUTypedValueRef Struct Reference

Variant object used to represent the value of a key-value attribute pair. More...

`#include <SketchUpAPI/model/typed_value.h>`

## Related Functions
(Note that these are not member functions.)
enum SUResult | SUTypedValueCreate (SUTypedValueRef *typed_value)
| Creates a typed value object. The created object must be released with SUTypedValueRelease(). More...
enum SUResult | SUTypedValueRelease (SUTypedValueRef *typed_value)
| Releases a typed value object that was previously created with SUTypedValueCreate(). More...
enum SUResult | SUTypedValueGetType (SUTypedValueRef typed_value, enum SUTypedValueType *type)
| Retrieves the type information of a typed value object. More...
enum SUResult | SUTypedValueGetByte (SUTypedValueRef typed_value, char *byte_value)
| Retrieves the byte value of a typed value object. More...
enum SUResult | SUTypedValueSetByte (SUTypedValueRef typed_value, char byte_value)
| Sets the byte value of a typed value object. More...
enum SUResult | SUTypedValueGetInt16 (SUTypedValueRef typed_value, int16_t *int16_value)
| Retrieves the int16 value of a typed value object. More...
enum SUResult | SUTypedValueSetInt16 (SUTypedValueRef typed_value, int16_t int16_value)
| Sets the int16 value of a typed value object. More...
enum SUResult | SUTypedValueGetInt32 (SUTypedValueRef typed_value, int32_t *int32_value)
| Retrieves the int32 value of a typed value object. More...
enum SUResult | SUTypedValueSetInt32 (SUTypedValueRef typed_value, int32_t int32_value)
| Sets the int32 value of a typed value object. More...
enum SUResult | SUTypedValueGetFloat (SUTypedValueRef typed_value, float *float_value)
| Retrieves the float value of a typed value object. More...
enum SUResult | SUTypedValueSetFloat (SUTypedValueRef typed_value, float float_value)
| Sets the float value of a typed value object. More...
enum SUResult | SUTypedValueGetDouble (SUTypedValueRef typed_value, double *double_value)
| Retrieves the double value of a typed value object. More...
enum SUResult | SUTypedValueSetDouble (SUTypedValueRef typed_value, double double_value)
| Sets the double value of a typed value object. More...
enum SUResult | SUTypedValueGetBool (SUTypedValueRef typed_value, bool *bool_value)
| Retrieves the boolean value of a typed value object. More...
enum SUResult | SUTypedValueSetBool (SUTypedValueRef typed_value, bool bool_value)
| Sets the boolean value of a typed value object. More...
enum SUResult | SUTypedValueGetColor (SUTypedValueRef typed_value, SUColor *color)
| Retrieves the color value of a typed value object. More...
enum SUResult | SUTypedValueSetColor (SUTypedValueRef typed_value, const SUColor *color)
| Sets the color value of a typed value object. More...
enum SUResult | SUTypedValueGetTime (SUTypedValueRef typed_value, int64_t *time_value)
| Retrieves the time value of a typed value object. The time value is in seconds since January 1, 1970. More...
enum SUResult | SUTypedValueSetTime (SUTypedValueRef typed_value, int64_t time_value)
| Sets the time value of a typed value object. The time value is in seconds since January 1, 1970. More...
enum SUResult | SUTypedValueGetString (SUTypedValueRef typed_value, SUStringRef *string_value)
| Retrieves the string value of a typed value object. More...
enum SUResult | SUTypedValueSetString (SUTypedValueRef typed_value, const char *string_value)
| Sets the string value of a typed value object. More...
enum SUResult | SUTypedValueGetVector3d (SUTypedValueRef typed_value, double vector3d_value[3])
| Retrieves the 3-element vector value of a typed value object. More...
enum SUResult | SUTypedValueSetVector3d (SUTypedValueRef typed_value, const double vector3d_value[3])
| Sets the 3-element vector value of a typed value object. More...
enum SUResult | SUTypedValueSetUnitVector3d (SUTypedValueRef typed_value, const double vector3d_value[3])
| Sets the 3D unit vector value of a typed value object. More...
enum SUResult | SUTypedValueGetArrayItems (SUTypedValueRef typed_value, size_t len, SUTypedValueRef values[], size_t *count)
| Retrieves the array of typed value objects from a typed value of type SUTypedValueType_Array. Note that the returned SUTypedValueRef objects will still be owned by their parent typed value array and therefore they must not be released by the caller. More...
enum SUResult | SUTypedValueSetArrayItems (SUTypedValueRef typed_value, size_t len, SUTypedValueRef values[])
| Sets the array of typed value objects of a typed value object. The elements of the given array are copied to the type value object. More...
enum SUResult | SUTypedValueGetNumArrayItems (SUTypedValueRef typed_value, size_t *count)
| Retrieves the number of typed value objects from a typed value of type SUTypedValueType_Array. More...

## Detailed Description

Variant object used to represent the value of a key-value attribute pair.

## Friends And Related Function Documentation

enum SUResult SUTypedValueCreate | ( | SUTypedValueRef * | typed_value | ) |
| related

Creates a typed value object. The created object must be released with SUTypedValueRelease().

Parameters

  [out] | typed_value | The created typed value object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if typed_value is NULL
  - SU_ERROR_OVERWRITE_VALID if typed_value references a valid object

enum SUResult SUTypedValueGetArrayItems | ( | SUTypedValueRef | typed_value,
|  | size_t | len,
|  | SUTypedValueRef | values[],
|  | size_t * | count
| ) |  |
| related

Retrieves the array of typed value objects from a typed value of type SUTypedValueType_Array. Note that the returned SUTypedValueRef objects will still be owned by their parent typed value array and therefore they must not be released by the caller.

Parameters

  [in] | typed_value | The typed value object.
  [in] | len | The length of the array to retrieve.
  [out] | values | The typed value objects retrieved.
  [out] | count | The actual number of typed value objects retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if values or count is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetBool | ( | SUTypedValueRef | typed_value,
|  | bool * | bool_value
| ) |  |
| related

Retrieves the boolean value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | bool_value | The boolean value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if bool_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetByte | ( | SUTypedValueRef | typed_value,
|  | char * | byte_value
| ) |  |
| related

Retrieves the byte value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | byte_value | The byte value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if byte_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetColor | ( | SUTypedValueRef | typed_value,
|  | SUColor * | color
| ) |  |
| related

Retrieves the color value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | color | The color value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetDouble | ( | SUTypedValueRef | typed_value,
|  | double * | double_value
| ) |  |
| related

Retrieves the double value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | double_value | The double value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if double_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetFloat | ( | SUTypedValueRef | typed_value,
|  | float * | float_value
| ) |  |
| related

Retrieves the float value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | float_value | The float value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if float_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetInt16 | ( | SUTypedValueRef | typed_value,
|  | int16_t * | int16_value
| ) |  |
| related

Retrieves the int16 value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | int16_value | The int16 value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if int16_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetInt32 | ( | SUTypedValueRef | typed_value,
|  | int32_t * | int32_value
| ) |  |
| related

Retrieves the int32 value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | int32_value | The int32 value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if int32_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetNumArrayItems | ( | SUTypedValueRef | typed_value,
|  | size_t * | count
| ) |  |
| related

Retrieves the number of typed value objects from a typed value of type SUTypedValueType_Array.

Parameters

  [in] | typed_value | The typed value object.
  [out] | count | The number of typed value objects in the array.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
  - SU_ERROR_NO_DATA if typed_value is not of type SUTypedValueType_Array.

enum SUResult SUTypedValueGetString | ( | SUTypedValueRef | typed_value,
|  | SUStringRef * | string_value
| ) |  |
| related

Retrieves the string value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | string_value | The string value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NO_DATA if typed_value is not of the requested type
  - SU_ERROR_NULL_POINTER_OUTPUT if string_value is NULL
  - SU_ERROR_INVALID_OUTPUT if string_value does not point to a valid SUStringRef object

enum SUResult SUTypedValueGetTime | ( | SUTypedValueRef | typed_value,
|  | int64_t * | time_value
| ) |  |
| related

Retrieves the time value of a typed value object. The time value is in seconds since January 1, 1970.

Parameters

  [in] | typed_value | The typed value object.
  [out] | time_value | The time value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if time_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueGetType | ( | SUTypedValueRef | typed_value,
|  | enum SUTypedValueType * | type
| ) |  |
| related

Retrieves the type information of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | type | The type information retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if type_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if type is NULL

enum SUResult SUTypedValueGetVector3d | ( | SUTypedValueRef | typed_value,
|  | double | vector3d_value[3]
| ) |  |
| related

Retrieves the 3-element vector value of a typed value object.

Parameters

  [in] | typed_value | The typed value object.
  [out] | vector3d_value | The 3-element vector value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if vector3d_value is NULL
  - SU_ERROR_NO_DATA if typed_value is not of the requested type

enum SUResult SUTypedValueRelease | ( | SUTypedValueRef * | typed_value | ) |
| related

Releases a typed value object that was previously created with SUTypedValueCreate().

Parameters

  [in,out] | typed_value | The typed value object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if typed_value is NULL
  - SU_ERROR_INVALID_INPUT if typed_value references an invalid object

enum SUResult SUTypedValueSetArrayItems | ( | SUTypedValueRef | typed_value,
|  | size_t | len,
|  | SUTypedValueRef | values[]
| ) |  |
| related

Sets the array of typed value objects of a typed value object. The elements of the given array are copied to the type value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | len | The number of typed value objects to set.
  [in] | values | The array of typed value objects to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if values is NULL

enum SUResult SUTypedValueSetBool | ( | SUTypedValueRef | typed_value,
|  | bool | bool_value
| ) |  |
| related

Sets the boolean value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | bool_value | The boolean value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetByte | ( | SUTypedValueRef | typed_value,
|  | char | byte_value
| ) |  |
| related

Sets the byte value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | byte_value | The byte value that is assigned.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetColor | ( | SUTypedValueRef | typed_value,
|  | const SUColor * | color
| ) |  |
| related

Sets the color value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | color | The color value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if color is NULL

enum SUResult SUTypedValueSetDouble | ( | SUTypedValueRef | typed_value,
|  | double | double_value
| ) |  |
| related

Sets the double value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | double_value | The double value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetFloat | ( | SUTypedValueRef | typed_value,
|  | float | float_value
| ) |  |
| related

Sets the float value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | float_value | The float value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetInt16 | ( | SUTypedValueRef | typed_value,
|  | int16_t | int16_value
| ) |  |
| related

Sets the int16 value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | int16_value | The int16 value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetInt32 | ( | SUTypedValueRef | typed_value,
|  | int32_t | int32_value
| ) |  |
| related

Sets the int32 value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | int32_value | The int32 value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetString | ( | SUTypedValueRef | typed_value,
|  | const char * | string_value
| ) |  |
| related

Sets the string value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | string_value | The string value to set. Assumed to be UTF-8 encoded.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if string_value is NULL

enum SUResult SUTypedValueSetTime | ( | SUTypedValueRef | typed_value,
|  | int64_t | time_value
| ) |  |
| related

Sets the time value of a typed value object. The time value is in seconds since January 1, 1970.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | time_value | The time value that is set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetUnitVector3d | ( | SUTypedValueRef | typed_value,
|  | const double | vector3d_value[3]
| ) |  |
| related

Sets the 3D unit vector value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | vector3d_value | The 3 vector components. Magnitude is ignored.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

enum SUResult SUTypedValueSetVector3d | ( | SUTypedValueRef | typed_value,
|  | const double | vector3d_value[3]
| ) |  |
| related

Sets the 3-element vector value of a typed value object.

Parameters

  [in,out] | typed_value | The typed value object.
  [in] | vector3d_value | The 3-element vector value to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if typed_value is not a valid object

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

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/typed_value.h