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

A dictionary type with SUStringRef objects as keys and SUTypedValueRef objects as values. More...

#include <SketchUpAPI/model/attribute_dictionary.h>

Inherits SUEntityRef.

Related Functions

(Note that these are not member functions.)

enum SUResult SUAttributeDictionaryCreate (SUAttributeDictionaryRef *dictionary, const char *name)
 Creates an attributes dictionary object. More...
 
enum SUResult SUAttributeDictionaryRelease (SUAttributeDictionaryRef *dictionary)
 Releases an attributes dictionary object and its associated attributes. If this dictionary has a parent, it will be removed from it. More...
 
SUEntityRef SUAttributeDictionaryToEntity (SUAttributeDictionaryRef dictionary)
 Converts from an SUAttributeDictionaryRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SUAttributeDictionaryRef SUAttributeDictionaryFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUAttributeDictionaryRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUAttributeDictionaryRef. More...
 
enum SUResult SUAttributeDictionaryGetName (SUAttributeDictionaryRef dictionary, SUStringRef *name)
 Retrieves the name of an attribute dictionary object. More...
 
enum SUResult SUAttributeDictionarySetValue (SUAttributeDictionaryRef dictionary, const char *key, SUTypedValueRef value_in)
 Inserts a key-value pair into an attribute dictionary object. More...
 
enum SUResult SUAttributeDictionaryGetValue (SUAttributeDictionaryRef dictionary, const char *key, SUTypedValueRef *value_out)
 Retrieves the value associated with a given key from an attribute dictionary. More...
 
enum SUResult SUAttributeDictionaryGetNumKeys (SUAttributeDictionaryRef dictionary, size_t *count)
 Retrieves the number of keys in an attribute dictionary object. More...
 
enum SUResult SUAttributeDictionaryGetKeys (SUAttributeDictionaryRef dictionary, size_t len, SUStringRef keys[], size_t *count)
 Retrieves the array of keys of an attribute dictionary object. More...
 

Detailed Description

A dictionary type with SUStringRef objects as keys and SUTypedValueRef objects as values.

Friends And Related Function Documentation

enum SUResult SUAttributeDictionaryCreate ( SUAttributeDictionaryRef dictionary,
const char *  name 
)
related

Creates an attributes dictionary object.

Since
SketchUp 2018 M0, API 6.0
Parameters
[out]dictionaryThe attributes dictionary object created.
[in]nameThe name of the attribute dictionary. Assumed to be UTF-8 encoded.
Returns
SUAttributeDictionaryRef SUAttributeDictionaryFromEntity ( SUEntityRef  entity)
related

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

Since
SketchUp 2014, API 2.0
Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUAttributeDictionaryRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
enum SUResult SUAttributeDictionaryGetKeys ( SUAttributeDictionaryRef  dictionary,
size_t  len,
SUStringRef  keys[],
size_t *  count 
)
related

Retrieves the array of keys of an attribute dictionary object.

Parameters
[in]dictionaryThe attribute dictionary object.
[in]lenThe number of keys to retrieve.
[out]keysThe keys retrieved.
[out]countThe number of keys retrieved.
Returns
enum SUResult SUAttributeDictionaryGetName ( SUAttributeDictionaryRef  dictionary,
SUStringRef name 
)
related

Retrieves the name of an attribute dictionary object.

Parameters
[in]dictionaryThe attribute dictionary object.
[out]nameThe name retrieved.
Returns
enum SUResult SUAttributeDictionaryGetNumKeys ( SUAttributeDictionaryRef  dictionary,
size_t *  count 
)
related

Retrieves the number of keys in an attribute dictionary object.

Parameters
[in]dictionaryThe attribute dictionary object.
[out]countThe number of keys.
Returns
enum SUResult SUAttributeDictionaryGetValue ( SUAttributeDictionaryRef  dictionary,
const char *  key,
SUTypedValueRef value_out 
)
related

Retrieves the value associated with a given key from an attribute dictionary.

Parameters
[in]dictionaryThe attribute dictionary object.
[in]keyThe key of the key-value pair. Assumed to be UTF-8 encoded.
[out]value_outThe value retrieved. Must be a valid object, i.e. must have been allocated via SUTypedValueCreate().
Returns
enum SUResult SUAttributeDictionaryRelease ( SUAttributeDictionaryRef dictionary)
related

Releases an attributes dictionary object and its associated attributes. If this dictionary has a parent, it will be removed from it.

Since
SketchUp 2018 M0, API 6.0
Parameters
[in,out]dictionaryThe attributes dictionary object.
Returns
enum SUResult SUAttributeDictionarySetValue ( SUAttributeDictionaryRef  dictionary,
const char *  key,
SUTypedValueRef  value_in 
)
related

Inserts a key-value pair into an attribute dictionary object.

Parameters
[in]dictionaryThe attribute dictionary object.
[in]keyThe key of the key-value pair. Assumed to be UTF-8 encoded.
[in]value_inThe value of the key-value pair.
Returns
SUEntityRef SUAttributeDictionaryToEntity ( SUAttributeDictionaryRef  dictionary)
related

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

Since
SketchUp 2014, API 2.0
Parameters
[in]dictionaryThe attribute dictionary object.
Returns
  • The converted SUEntityRef if dictionary is a valid object
  • If not, the returned reference will be invalid

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