SketchUp SDK
|
Go to the source code of this file.
Data Structures | |
struct | SUModelStatistics |
Contains an array of entity counts that can be indexed per entity type. More... | |
Enumerations | |
enum | SUModelUnits { SUModelUnits_Inches, SUModelUnits_Feet, SUModelUnits_Millimeters, SUModelUnits_Centimeters, SUModelUnits_Meters } |
Units options settings. More... | |
Functions | |
SU_RESULT | SUModelCreate (SUModelRef *model) |
Creates an empty model object for the purposes of writing a SketchUp document. This model object must be released with SUModelRelease. More... | |
SU_RESULT | SUModelCreateFromFile (SUModelRef *model, const char *file_path) |
Creates a model from a SketchUp file on local disk. More... | |
SU_RESULT | SUModelRelease (SUModelRef *model) |
Releases a model object and its associated resources. The root component of the model object and all its child objects must not be released explicitly. More... | |
SU_RESULT | SUModelGetEntities (SUModelRef model, SUEntitiesRef *entities) |
Retrieves model entities. More... | |
SU_RESULT | SUModelGetNumMaterials (SUModelRef model, size_t *count) |
Retrieves the number of materials in a model object. More... | |
SU_RESULT | SUModelGetMaterials (SUModelRef model, size_t len, SUMaterialRef materials[], size_t *count) |
Retrieves all the materials associated with a model object. More... | |
SU_RESULT | SUModelAddMaterials (SUModelRef model, size_t len, const SUMaterialRef materials[]) |
Adds materials to a model object. More... | |
SU_RESULT | SUModelGetNumComponentDefinitions (SUModelRef model, size_t *count) |
Retrieves the number of components associated with a model. More... | |
SU_RESULT | SUModelGetComponentDefinitions (SUModelRef model, size_t len, SUComponentDefinitionRef components[], size_t *count) |
Retrieves the components that are associated with a model. More... | |
SU_RESULT | SUModelAddComponentDefinitions (SUModelRef model, size_t len, const SUComponentDefinitionRef components[]) |
Adds component definitions to a model object. More... | |
SU_RESULT | SUModelSaveToFile (SUModelRef model, const char *file_path) |
Serializes the model object and its entities to local disk. More... | |
SU_RESULT | SUModelGetCamera (SUModelRef model, SUCameraRef *camera) |
Retrieves the camera of a model object. More... | |
SU_RESULT | SUModelGetNumScenes (SUModelRef model, size_t *num_scenes) |
Retrieves the number of scene cameras of a model object. More... | |
SU_RESULT | SUModelGetNumLayers (SUModelRef model, size_t *count) |
Retrieves the number of layers in a model object. More... | |
SU_RESULT | SUModelGetLayers (SUModelRef model, size_t len, SULayerRef layers[], size_t *count) |
Retrieves the layers in a model object. More... | |
SU_RESULT | SUModelAddLayers (SUModelRef model, size_t len, const SULayerRef layers[]) |
Adds layer objects to a model object. More... | |
SU_RESULT | SUModelGetDefaultLayer (SUModelRef model, SULayerRef *layer) |
Retrieves the default layer object of a model object. More... | |
SU_RESULT | SUModelGetVersion (SUModelRef model, int *major, int *minor, int *build) |
Retrieves the version of a model object. The version consists of three numbers: major version number, minor version number, and the build number. More... | |
SU_RESULT | SUModelGetNumAttributeDictionaries (SUModelRef model, size_t *count) |
Retrieves the number of attribute dictionaries of a model object. More... | |
SU_RESULT | SUModelGetAttributeDictionaries (SUModelRef model, size_t len, SUAttributeDictionaryRef dictionaries[], size_t *count) |
Retrieves the attribute dictionaries of a model object. More... | |
SU_RESULT | SUModelGetAttributeDictionary (SUModelRef model, const char *name, SUAttributeDictionaryRef *dictionary) |
Retrieves the attribute dictionary of a model object that has the given name. If a dictionary with the given name does not exist, one is added to the model object. More... | |
SU_RESULT | SUModelGetLocation (SUModelRef model, SULocationRef *location) |
Retrieves the location information of a given model. More... | |
SU_RESULT | SUModelGetStatistics (SUModelRef model, struct SUModelStatistics *statistics) |
Calculates the sum of all entities by type in the model. More... | |
SU_RESULT | SUModelSetGeoReference (SUModelRef model, double latitude, double longitude, double altitude, bool is_z_value_centered, bool is_on_ocean_floor) |
Georeferences the model. More... | |
SU_RESULT | SUModelGetRenderingOptions (SUModelRef model, SURenderingOptionsRef *rendering_options) |
Retrieves the rendering options of a model object. More... | |
SU_RESULT | SUModelGetOptionsManager (SUModelRef model, SUOptionsManagerRef *options_manager) |
Retrieves options manager associated with the model. More... | |
SU_RESULT | SUModelGetNorthCorrection (SUModelRef model, double *north_correction) |
Retrieves the angle which will rotate the north direction to the y-axis for a given model. More... | |
SU_RESULT | SUModelMergeCoplanarFaces (SUModelRef model) |
Merges all adjacent, coplanar faces in the model. More... | |
SU_RESULT | SUModelGetScenes (SUModelRef model, size_t len, SUSceneRef scenes[], size_t *count) |
Retrieves all the scenes associated with a model object. More... | |
SU_RESULT | SUModelAddScenes (SUModelRef model, size_t len, const SUSceneRef scenes[]) |
Adds scenes to a model object. More... | |
SU_RESULT | SUModelGetName (SUModelRef model, SUStringRef *name) |
Retrieves the name of a model object. More... | |
SU_RESULT | SUModelSetName (SUModelRef model, const char *name) |
Sets the name of a model object. More... | |
SU_RESULT | SUModelGetUnits (SUModelRef model, enum SUModelUnits *units) |
Returns the units associated with the given model. More... | |
enum SUModelUnits |
SU_RESULT SUModelAddComponentDefinitions | ( | SUModelRef | model, |
size_t | len, | ||
const SUComponentDefinitionRef | components[] | ||
) |
Adds component definitions to a model object.
[in] | model | The model object. |
[in] | len | The number of component definitions to add. |
[in] | components | The array of component definitions to add. |
SU_RESULT SUModelAddLayers | ( | SUModelRef | model, |
size_t | len, | ||
const SULayerRef | layers[] | ||
) |
Adds layer objects to a model object.
[in] | model | The model object. |
[in] | len | The number of layers to add. |
[in] | layers | The layers to add. |
SU_RESULT SUModelAddMaterials | ( | SUModelRef | model, |
size_t | len, | ||
const SUMaterialRef | materials[] | ||
) |
Adds materials to a model object.
[in] | model | The model object. |
[in] | len | The number of material objects to add. |
[in] | materials | The array of material objects to add. |
SU_RESULT SUModelAddScenes | ( | SUModelRef | model, |
size_t | len, | ||
const SUSceneRef | scenes[] | ||
) |
Adds scenes to a model object.
[in] | model | The model object. |
[in] | len | The number of scene objects to add. |
[in] | scenes | The array of scene objects to add. |
SU_RESULT SUModelCreate | ( | SUModelRef * | model | ) |
Creates an empty model object for the purposes of writing a SketchUp document. This model object must be released with SUModelRelease.
[out] | model | The model object created. |
SU_RESULT SUModelCreateFromFile | ( | SUModelRef * | model, |
const char * | file_path | ||
) |
Creates a model from a SketchUp file on local disk.
[out] | model | The model object created. |
[in] | file_path | The source file path of the SketchUp file. Assumed to be UTF-8 encoded. |
SU_RESULT SUModelGetAttributeDictionaries | ( | SUModelRef | model, |
size_t | len, | ||
SUAttributeDictionaryRef | dictionaries[], | ||
size_t * | count | ||
) |
Retrieves the attribute dictionaries of a model object.
[in] | model | The model object. |
[in] | len | The number of attribute dictionaries to retrieve. |
[out] | dictionaries | The dictionaries retrieved. |
[out] | count | The number of attribute dictionaries retrieved. |
SU_RESULT SUModelGetAttributeDictionary | ( | SUModelRef | model, |
const char * | name, | ||
SUAttributeDictionaryRef * | dictionary | ||
) |
Retrieves the attribute dictionary of a model object that has the given name. If a dictionary with the given name does not exist, one is added to the model object.
[in] | model | The model object. |
[in] | name | The name of the attribute dictionary to retrieve. Assumed to be UTF-8 encoded. |
[out] | dictionary | The dictionary object retrieved. |
SU_RESULT SUModelGetCamera | ( | SUModelRef | model, |
SUCameraRef * | camera | ||
) |
Retrieves the camera of a model object.
[in] | model | The model object. |
[out] | camera | The camera object retrieved. |
SU_RESULT SUModelGetComponentDefinitions | ( | SUModelRef | model, |
size_t | len, | ||
SUComponentDefinitionRef | components[], | ||
size_t * | count | ||
) |
Retrieves the components that are associated with a model.
[in] | model | The model object. |
[in] | len | The number of components to retrieve. |
[out] | components | The components retrieved. |
[out] | count | The number of components retrieved. |
SU_RESULT SUModelGetDefaultLayer | ( | SUModelRef | model, |
SULayerRef * | layer | ||
) |
Retrieves the default layer object of a model object.
[in] | model | The model object. |
[out] | layer | The layer object retrieved. |
SU_RESULT SUModelGetEntities | ( | SUModelRef | model, |
SUEntitiesRef * | entities | ||
) |
Retrieves model entities.
[in] | model | The model object. |
[out] | entities | The entities retrieved. |
SU_RESULT SUModelGetLayers | ( | SUModelRef | model, |
size_t | len, | ||
SULayerRef | layers[], | ||
size_t * | count | ||
) |
Retrieves the layers in a model object.
[in] | model | The model object. |
[in] | len | The number of layers to retrieve. |
[out] | layers | The layers retrieved. |
[out] | count | The number of layers retrieved. |
SU_RESULT SUModelGetLocation | ( | SUModelRef | model, |
SULocationRef * | location | ||
) |
Retrieves the location information of a given model.
[in] | model | The model object. |
[out] | location | The location retrieved. |
SU_RESULT SUModelGetMaterials | ( | SUModelRef | model, |
size_t | len, | ||
SUMaterialRef | materials[], | ||
size_t * | count | ||
) |
Retrieves all the materials associated with a model object.
[in] | model | The model object. |
[in] | len | The number of material objects to retrieve. |
[out] | materials | The material objects retrieved. |
[out] | count | The number of material objects retrieved. |
SU_RESULT SUModelGetName | ( | SUModelRef | model, |
SUStringRef * | name | ||
) |
Retrieves the name of a model object.
[in] | model | The model object. |
[out] | name | The destination of the retrieved name object. |
SU_RESULT SUModelGetNorthCorrection | ( | SUModelRef | model, |
double * | north_correction | ||
) |
Retrieves the angle which will rotate the north direction to the y-axis for a given model.
[in] | model | The model object. |
[out] | north_correction | The north correction angle retrieved (in degrees). |
SU_RESULT SUModelGetNumAttributeDictionaries | ( | SUModelRef | model, |
size_t * | count | ||
) |
Retrieves the number of attribute dictionaries of a model object.
[in] | model | The model object. |
[out] | count | The number of attribute dictionaries available. |
SU_RESULT SUModelGetNumComponentDefinitions | ( | SUModelRef | model, |
size_t * | count | ||
) |
Retrieves the number of components associated with a model.
[in] | model | The model object. |
[out] | count | The number of components available. |
SU_RESULT SUModelGetNumLayers | ( | SUModelRef | model, |
size_t * | count | ||
) |
Retrieves the number of layers in a model object.
[in] | model | The model object. |
[out] | count | The number of layers available. |
SU_RESULT SUModelGetNumMaterials | ( | SUModelRef | model, |
size_t * | count | ||
) |
Retrieves the number of materials in a model object.
[in] | model | The model object. |
[in] | count | The number of material objects available. |
SU_RESULT SUModelGetNumScenes | ( | SUModelRef | model, |
size_t * | num_scenes | ||
) |
Retrieves the number of scene cameras of a model object.
[in] | model | The model object. |
[out] | num_scenes | The number of scenes available. |
SU_RESULT SUModelGetOptionsManager | ( | SUModelRef | model, |
SUOptionsManagerRef * | options_manager | ||
) |
Retrieves options manager associated with the model.
[in] | model | The model object. |
[out] | options_manager | The options manager object retrieved. |
SU_RESULT SUModelGetRenderingOptions | ( | SUModelRef | model, |
SURenderingOptionsRef * | rendering_options | ||
) |
Retrieves the rendering options of a model object.
[in] | model | The model object. |
[out] | rendering_options | The rendering options object retrieved. This object is owned by the model and must not be explicitly released. |
SU_RESULT SUModelGetScenes | ( | SUModelRef | model, |
size_t | len, | ||
SUSceneRef | scenes[], | ||
size_t * | count | ||
) |
Retrieves all the scenes associated with a model object.
[in] | model | The model object. |
[in] | len | The number of scene objects to retrieve. |
[out] | scenes | The scene objects retrieved. |
[out] | count | The number of scene objects retrieved. |
SU_RESULT SUModelGetStatistics | ( | SUModelRef | model, |
struct SUModelStatistics * | statistics | ||
) |
Calculates the sum of all entities by type in the model.
[in] | model | The model object. |
[out] | statistics | The SUModelStatistics struct that will be populated with the number of each entity type in the model. |
SU_RESULT SUModelGetUnits | ( | SUModelRef | model, |
enum SUModelUnits * | units | ||
) |
Returns the units associated with the given model.
[in] | model | The model object. |
[out] | units | The units retrieved. |
SU_RESULT SUModelGetVersion | ( | SUModelRef | model, |
int * | major, | ||
int * | minor, | ||
int * | build | ||
) |
Retrieves the version of a model object. The version consists of three numbers: major version number, minor version number, and the build number.
[in] | model | The model object. |
[out] | major | The major version number retrieved. |
[out] | minor | The minor version number retrieved. |
[out] | build | The build version number retrieved. |
SU_RESULT SUModelMergeCoplanarFaces | ( | SUModelRef | model | ) |
Merges all adjacent, coplanar faces in the model.
[in] | model | The model object. |
SU_RESULT SUModelRelease | ( | SUModelRef * | model | ) |
Releases a model object and its associated resources. The root component of the model object and all its child objects must not be released explicitly.
[in] | model | The model object. |
SU_RESULT SUModelSaveToFile | ( | SUModelRef | model, |
const char * | file_path | ||
) |
Serializes the model object and its entities to local disk.
[in] | model | The model object. |
[in] | file_path | The file path destination of the serialization operation. Assumed to be UTF-8 encoded. |
SU_RESULT SUModelSetGeoReference | ( | SUModelRef | model, |
double | latitude, | ||
double | longitude, | ||
double | altitude, | ||
bool | is_z_value_centered, | ||
bool | is_on_ocean_floor | ||
) |
Georeferences the model.
[in] | model | The model object. |
[in] | latitude | Latitude of the model. |
[in] | longitude | Longitude of the model. |
[in] | altitude | Altitude of the model. |
[in] | is_z_value_centered | Indicates if z value should be centered. |
[in] | is_on_ocean_floor | Indicates whether the model is on the ocean floor. |
SU_RESULT SUModelSetName | ( | SUModelRef | model, |
const char * | name | ||
) |
Sets the name of a model object.
[in] | model | The model object. |
[in] | name | The name of the model object. Assumed to be UTF-8 encoded. |