LayOut C API

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Enumerations | Functions
sketchupmodel.h File Reference
`#include <LayOutAPI/common.h>`
`#include <LayOutAPI/geometry/geometry.h>`
`#include <LayOutAPI/model/defs.h>`
`#include <SketchUpAPI/model/defs.h>`

Go to the source code of this file.

## Enumerations
enum | LOSketchUpModelRenderMode { LOSketchUpModelRenderMode_NoOverride = -1, LOSketchUpModelRenderMode_Raster = 0, LOSketchUpModelRenderMode_Hybrid, LOSketchUpModelRenderMode_Vector, LONumSketchUpModelRenderModes }
| Defines the different rendering modes available for a SketchUp model. More...
enum | LOSketchUpModelStandardView { LOSketchUpModelStandardView_Top = 0, LOSketchUpModelStandardView_RelativeTop, LOSketchUpModelStandardView_Bottom, LOSketchUpModelStandardView_RelativeBottom, LOSketchUpModelStandardView_Front, LOSketchUpModelStandardView_Back, LOSketchUpModelStandardView_Left, LOSketchUpModelStandardView_Right, LOSketchUpModelStandardView_Iso, LONumSketchUpModelStandardViews }
| Defines the standard views available for a SketchUp model. Relative views are not necessarily aligned to the corresponding axes like regular views, but rather they maintain the alignment from the previous position of the camera. More...

## Functions
LO_RESULT | LOSketchUpModelCreate (LOSketchUpModelRef *model, const char *path, const LOAxisAlignedRect2D *bounds)
| Creates a new SketchUp model object with the specified bounds that references the specified SketchUp file. More...
LO_RESULT | LOSketchUpModelAddReference (LOSketchUpModelRef model)
| Adds a reference to a SketchUp model object. More...
LO_RESULT | LOSketchUpModelRelease (LOSketchUpModelRef *model)
| Releases a SketchUp model object. The object will be invalidated if releasing the last reference. More...
LO_EXPORT LOSketchUpModelRef | LOSketchUpModelFromEntity (LOEntityRef entity)
| Converts from a LOEntityRef to a LOSketchUpModelRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOSketchUpModelRef. More...
LO_EXPORT LOEntityRef | LOSketchUpModelToEntity (LOSketchUpModelRef model)
| Converts from a LOSketchUpModelRef to a LOEntityRef. This is essentially an upcast operation. More...
LO_RESULT | LOSketchUpModelSetViewportOverridesOnModel (LOSketchUpModelRef model)
| Applies the SketchUp model viewport's overrides on the SketchUp model retrieved by LOSketchUpModelGetModel. More...
LO_RESULT | LOSketchUpModelResetViewportOverridesOnModel (LOSketchUpModelRef model)
| Resets the SketchUp model used by this viewport back to its default state. More...
LO_RESULT | LOSketchUpModelGetModel (LOSketchUpModelRef model, SUModelRef *sumodel)
| Gets the `SUModelRef` representation of the SketchUp model. More...
LO_RESULT | LOSketchUpModelGetRenderMode (LOSketchUpModelRef model, LOSketchUpModelRenderMode *render_mode)
| Gets the render mode of the SketchUp model. More...
LO_RESULT | LOSketchUpModelSetRenderMode (LOSketchUpModelRef model, LOSketchUpModelRenderMode render_mode)
| Sets the render mode of the SketchUp model. More...
LO_RESULT | LOSketchUpModelRender (LOSketchUpModelRef model)
| Renders the SketchUp model. If the model belongs to a LODocumentRef, then the render will be performed at the resolution set in document.page_info (see LODocumentRef and LOPageInfoRef). Otherwise, the render will be performed at Low resolution. More...
LO_RESULT | LOSketchUpModelIsRenderNeeded (LOSketchUpModelRef model, bool *render_needed)
| Gets the status indicating whether the SketchUp model needs to be rendered. More...
LO_RESULT | LOSketchUpModelGetNumberOfAvailableScenes (LOSketchUpModelRef model, size_t *number_of_scenes)
| Gets the number of scenes that are available for a SketchUp model. Use this to determine the size of the array that should be passed to LOSketchUpModelGetAvailableScenes. More...
LO_RESULT | LOSketchUpModelGetAvailableScenes (LOSketchUpModelRef model, size_t len, SUStringRef scenes[], size_t *count)
| Gets the array of scenes that are available for a SketchUp model. The first scene returned will always be the default scene, called "Last saved SketchUp View". More...
LO_RESULT | LOSketchUpModelGetCurrentScene (LOSketchUpModelRef model, size_t *scene_index, bool *scene_modified)
| Gets the most recently selected scene of the SketchUp model. More...
LO_RESULT | LOSketchUpModelSetCurrentScene (LOSketchUpModelRef model, size_t scene_index)
| Sets the scene of the SketchUp model. More...
LO_RESULT | LOSketchUpModelGetCameraModified (LOSketchUpModelRef model, bool *modified)
| Gets whether the SketchUp model's camera has been modified. More...
LO_RESULT | LOSketchUpModelResetCamera (LOSketchUpModelRef model)
| Resets the SketchUp model's camera to the scene's setting. More...
LO_RESULT | LOSketchUpModelGetCamera (LOSketchUpModelRef model, SUCameraRef *sucamera)
| Gets a SUCameraRef representing the camera for the viewport. More...
LO_RESULT | LOSketchUpModelSetCamera (LOSketchUpModelRef model, SUCameraRef sucamera)
| Sets the camera for the viewport. More...
LO_RESULT | LOSketchUpModelGetEffectsModified (LOSketchUpModelRef model, bool *modified)
| Gets whether the SketchUp model's shadow or fog effects have been modified. More...
LO_RESULT | LOSketchUpModelResetEffects (LOSketchUpModelRef model)
| Resets the SketchUp model's shadow and fog effects to the scene's settings. More...
LO_RESULT | LOSketchUpModelGetStyleModified (LOSketchUpModelRef model, bool *modified)
| Gets whether the SketchUp model's style has been modified. More...
LO_RESULT | LOSketchUpModelResetStyle (LOSketchUpModelRef model)
| Resets the SketchUp model's style to the scene's setting. More...
LO_RESULT | LOSketchUpModelGetLayersModified (LOSketchUpModelRef model, bool *modified)
| Gets whether the SketchUp model's layers have been modified. More...
LO_RESULT | LOSketchUpModelResetLayers (LOSketchUpModelRef model)
| Resets the SketchUp model's layers to the scene's setting. More...
LO_RESULT | LOSketchUpModelGetDisplayBackground (LOSketchUpModelRef model, bool *display_background)
| Gets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector. More...
LO_RESULT | LOSketchUpModelSetDisplayBackground (LOSketchUpModelRef model, bool display_background)
| Sets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector. More...
LO_RESULT | LOSketchUpModelGetLineWeight (LOSketchUpModelRef model, double *line_weight)
| Gets the line weight in points for the SketchUp model. More...
LO_RESULT | LOSketchUpModelSetLineWeight (LOSketchUpModelRef model, double line_weight)
| Sets the line weight in points for the SketchUp model. More...
LO_RESULT | LOSketchUpModelGetDashScale (LOSketchUpModelRef model, double *dash_scale)
| Gets the scale for dashes in the SketchUp model. A scale value of 0.0 means the dashes are scaled based on the line weight. More...
LO_RESULT | LOSketchUpModelSetDashScale (LOSketchUpModelRef model, double dash_scale)
| Sets the scale for dashes in the SketchUp model. A scale value of 0.0 or lower will "auto" scale the dashes based on the line weight. More...
LO_RESULT | LOSketchUpModelGetPerspective (LOSketchUpModelRef model, bool *perspective)
| Gets whether or not the view is rendered in perspective mode. More...
LO_RESULT | LOSketchUpModelSetPerspective (LOSketchUpModelRef model, bool perspective)
| Sets whether or not the view is rendered in perspective mode. More...
LO_RESULT | LOSketchUpModelGetStandardView (LOSketchUpModelRef model, LOSketchUpModelStandardView *view)
| Gets the standard view that a SketchUp model is currently set to. More...
LO_RESULT | LOSketchUpModelSetStandardView (LOSketchUpModelRef model, LOSketchUpModelStandardView view)
| Sets a SketchUp model to use a standard view. More...
LO_RESULT | LOSketchUpModelGetScale (LOSketchUpModelRef model, double *scale)
| Gets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode. More...
LO_RESULT | LOSketchUpModelSetScale (LOSketchUpModelRef model, double scale)
| Sets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode. More...
LO_RESULT | LOSketchUpModelGetPreserveScaleOnResize (LOSketchUpModelRef model, bool *preserve_scale)
| Gets whether or not the scale is preserved when the SketchUp model is resized. More...
LO_RESULT | LOSketchUpModelSetPreserveScaleOnResize (LOSketchUpModelRef model, bool preserve_scale)
| Sets whether or not the scale is preserved when the SketchUp model is resized. More...
LO_RESULT | LOSketchUpModelConvertModelPointToPaperPoint (LOSketchUpModelRef model, const LOPoint3D *model_point, LOPoint2D *paper_point)
| Converts a 3D model space point in the SketchUp model to a 2D paper space point on the page. More...
LO_RESULT | LOSketchUpModelGetClipMask (LOSketchUpModelRef model, LOEntityRef *clip_mask)
| Returns any clip mask assigned to the SketchUp model. More...
LO_RESULT | LOSketchUpModelSetClipMask (LOSketchUpModelRef model, LOEntityRef clip_mask)
| Sets the clip mask of the SketchUp model. A clip mask defines a region of the entity that is visible. This allows you to crop with arbitrary shapes. This operation will replace any clip mask that is already assigned to this model. The entity being used must not be already part of a document or group. The clip mask entity must be either a rectangle, ellipse or a path. More...
LO_RESULT | LOSketchUpModelGetExplodedEntities (LOSketchUpModelRef model, LOEntityListRef entity_list)
| Creates the entities that represent the SketchUp model in its exploded form and adds them to a LOEntityListRef. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released. More...
LO_RESULT | LOSketchUpModelGetOutputEntities (LOSketchUpModelRef model, LOEntityListRef entity_list)
| Creates the entities that represent the SketchUp model using its output settings and adds them to a LOEntityListRef. More...

## Enumeration Type Documentation

enum LOSketchUpModelRenderMode

Defines the different rendering modes available for a SketchUp model.

Note
  New for LayOut 2023.1, API 8.1 is the value LOSketchUpModelRenderMode_NoOverride. The value is only used for the document render mode override, to indicate that the output render mode should match the edit render mode, which is set per LOSketchUpModelRef.

Enumerator
LOSketchUpModelRenderMode_NoOverride | Output render mode matches edit render mode.
LOSketchUpModelRenderMode_Raster | Raster rendering.
LOSketchUpModelRenderMode_Hybrid | Hybrid rendering.
LOSketchUpModelRenderMode_Vector | Vector rendering.
LONumSketchUpModelRenderModes |

enum LOSketchUpModelStandardView

Defines the standard views available for a SketchUp model. Relative views are not necessarily aligned to the corresponding axes like regular views, but rather they maintain the alignment from the previous position of the camera.

Enumerator
LOSketchUpModelStandardView_Top | Top. This view is aligned with the X and Y axes.
LOSketchUpModelStandardView_RelativeTop | Top (Relative). This top view is oriented relative to the previous camera position.
LOSketchUpModelStandardView_Bottom | Bottom. This view is aligned with the X and Y axes.
LOSketchUpModelStandardView_RelativeBottom | Bottom (Relative). This bottom view is oriented relative to the previous camera position.
LOSketchUpModelStandardView_Front | Front. This view is aligned with the X and Z axes.
LOSketchUpModelStandardView_Back | Back. This view is aligned with the X and Z axes.
LOSketchUpModelStandardView_Left | Left. This view is aligned with the Y and Z axes.
LOSketchUpModelStandardView_Right | Right. This view is aligned with the Y and Z axes.
LOSketchUpModelStandardView_Iso | Iso. This is aligned with the nearest isometric axes to the current view.
LONumSketchUpModelStandardViews |

## Function Documentation

LO_RESULT LOSketchUpModelAddReference | ( | LOSketchUpModelRef | model | ) |

Adds a reference to a SketchUp model object.

Parameters

  [in] | model | The SketchUp model object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object

LO_RESULT LOSketchUpModelConvertModelPointToPaperPoint | ( | LOSketchUpModelRef | model,
|  | const LOPoint3D * | model_point,
|  | LOPoint2D * | paper_point
| ) |  |

Converts a 3D model space point in the SketchUp model to a 2D paper space point on the page.

Parameters

  [in] | model | The SketchUp model object.
  [in] | model_point | The 3D model space point.
  [out] | paper_point | The 2D paper space point.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_INPUT if model_point is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if paper_point is NULL

LO_RESULT LOSketchUpModelCreate | ( | LOSketchUpModelRef * | model,
|  | const char * | path,
|  | const LOAxisAlignedRect2D * | bounds
| ) |  |

Creates a new SketchUp model object with the specified bounds that references the specified SketchUp file.

Parameters

  [out] | model | The SketchUp model object.
  [in] | path | The path to the SketchUp file.
  [in] | bounds | The starting dimensions of the SketchUp model.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if model is NULL
  - SU_ERROR_OVERWRITE_VALID if *model already refers to a valid object
  - SU_ERROR_NULL_POINTER_INPUT if path is NULL
  - SU_ERROR_NULL_POINTER_INPUT if bounds is NULL
  - SU_ERROR_OUT_OF_RANGE if bounds has a width or height of zero
  - SU_ERROR_SERIALIZATION if the .skp file could not be loaded
  - SU_ERROR_NO_DATA if the .skp file could not be found

LO_EXPORT LOSketchUpModelRef LOSketchUpModelFromEntity | ( | LOEntityRef | entity | ) |

Converts from a LOEntityRef to a LOSketchUpModelRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOSketchUpModelRef.

Parameters

  [in] | entity | The entity object.

Returns
  - The converted LOSketchUpModelRef if the downcast operation succeeds
  - If not, the returned reference will be invalid

LO_RESULT LOSketchUpModelGetAvailableScenes | ( | LOSketchUpModelRef | model,
|  | size_t | len,
|  | SUStringRef | scenes[],
|  | size_t * | count
| ) |  |

Gets the array of scenes that are available for a SketchUp model. The first scene returned will always be the default scene, called "Last saved SketchUp View".

Parameters

  [in] | model | The SketchUp model object.
  [in] | len | The maximum number of scenes to retrieve.
  [out] | scenes | The names of the scenes retrieved.
  [out] | count | The number of scenes retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if scenes or count is NULL

LO_RESULT LOSketchUpModelGetCamera | ( | LOSketchUpModelRef | model,
|  | SUCameraRef * | sucamera
| ) |  |

Gets a SUCameraRef representing the camera for the viewport.

Since
  LayOut 2026.0, API 11.0

Parameters

  [in] | model | The SketchUp model object.
  [out] | sucamera | The camera reference object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `model` does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if `sucamera` is NULL
  - SU_ERROR_INVALID_OUTPUT if `*sucamera` does not refer to a valid object

LO_RESULT LOSketchUpModelGetCameraModified | ( | LOSketchUpModelRef | model,
|  | bool * | modified
| ) |  |

Gets whether the SketchUp model's camera has been modified.

Parameters

  [in] | model | The SketchUp model object.
  [out] | modified | Indicates whether or not the camera has been modified in LayOut.

Since
  LayOut 2020.1, API 5.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if modified is NULL

LO_RESULT LOSketchUpModelGetClipMask | ( | LOSketchUpModelRef | model,
|  | LOEntityRef * | clip_mask
| ) |  |

Returns any clip mask assigned to the SketchUp model.

Since
  LayOut 2017, API 2.0

Parameters

  [in] | model | The SketchUp model object.
  [out] | clip_mask | The clip mask of the SketchUp model.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if clip_mask is NULL
  - SU_ERROR_OVERWRITE_VALID if *clip_mask already refers to a valid object
  - SU_ERROR_NO_DATA if the model is not being clipped by a clip mask

LO_RESULT LOSketchUpModelGetCurrentScene | ( | LOSketchUpModelRef | model,
|  | size_t * | scene_index,
|  | bool * | scene_modified
| ) |  |

Gets the most recently selected scene of the SketchUp model.

Parameters

  [in] | model | The SketchUp model object.
  [out] | scene_index | The index of the SketchUp model's scene. This is an index into the list of available scenes returned by LOSketchUpModelGetAvailableScenes.
  [out] | scene_modified | Indicates whether or not the scene has been modified in LayOut.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if scene_index or scene_modified is NULL
  - SU_ERROR_NO_DATA if the most recently selected scene no longer exists

LO_RESULT LOSketchUpModelGetDashScale | ( | LOSketchUpModelRef | model,
|  | double * | dash_scale
| ) |  |

Gets the scale for dashes in the SketchUp model. A scale value of 0.0 means the dashes are scaled based on the line weight.

Since
  LayOut 2019, API 4.0

Parameters

  [in] | model | The SketchUp model object.
  [out] | dash_scale | Dash scale. Will be in the range [0, 10].

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if dash_scale is NULL

LO_RESULT LOSketchUpModelGetDisplayBackground | ( | LOSketchUpModelRef | model,
|  | bool * | display_background
| ) |  |

Gets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector.

Parameters

  [in] | model | The SketchUp model object.
  [out] | display_background | True if the background is displayed.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if display_background is NULL

LO_RESULT LOSketchUpModelGetEffectsModified | ( | LOSketchUpModelRef | model,
|  | bool * | modified
| ) |  |

Gets whether the SketchUp model's shadow or fog effects have been modified.

Parameters

  [in] | model | The SketchUp model object.
  [out] | modified | Indicates whether or not the shadow or fog effects have been modified in LayOut.

Since
  LayOut 2020.1, API 5.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if modified is NULL

LO_RESULT LOSketchUpModelGetExplodedEntities | ( | LOSketchUpModelRef | model,
|  | LOEntityListRef | entity_list
| ) |  |

Creates the entities that represent the SketchUp model in its exploded form and adds them to a LOEntityListRef. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released.

Note
  Starting in LayOut 2018 M0, API 3.0 - an exploded raster-rendered model will now wrap the LOImageRef in a LOGroupRef.

Parameters

  [in] | model | The SketchUp model object.
  [in] | entity_list | The entity list object to add the new entities to.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object

LO_RESULT LOSketchUpModelGetLayersModified | ( | LOSketchUpModelRef | model,
|  | bool * | modified
| ) |  |

Gets whether the SketchUp model's layers have been modified.

Note
  In SketchUp 2020, SketchUp "layers" were renamed to "tags". For consistency with the SketchUp API, this will continue to refer to "tags" as "layers".

Since
  LayOut 2020.1, API 5.1

Parameters

  [in] | model | The SketchUp model object.
  [out] | modified | Indicates whether or not the tag have been modified in LayOut.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if modified is NULL

LO_RESULT LOSketchUpModelGetLineWeight | ( | LOSketchUpModelRef | model,
|  | double * | line_weight
| ) |  |

Gets the line weight in points for the SketchUp model.

Parameters

  [in] | model | The SketchUp model object.
  [out] | line_weight | Line weight in points.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if line_weight is NULL

LO_RESULT LOSketchUpModelGetModel | ( | LOSketchUpModelRef | model,
|  | SUModelRef * | sumodel
| ) |  |

Gets the `SUModelRef` representation of the SketchUp model.

Note
  This `SUModelRef` is shared by all SketchUp model viewports that use the same file reference. To apply the SketchUp model viewport's overrides to the `SUModelRef` call LOSketchUpModelSetViewportOverridesOnModel. You must reset the SketchUp model back to its default state by calling LOSketchUpModelResetViewportOverridesOnModel once you are done.

Since
  LayOut 2017, API 2.0

Parameters

  [in] | model | The SketchUp model object.
  [out] | sumodel | The model reference object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if sumodel is NULL

LO_RESULT LOSketchUpModelGetNumberOfAvailableScenes | ( | LOSketchUpModelRef | model,
|  | size_t * | number_of_scenes
| ) |  |

Gets the number of scenes that are available for a SketchUp model. Use this to determine the size of the array that should be passed to LOSketchUpModelGetAvailableScenes.

Parameters

  [in] | model | The SketchUp model object.
  [out] | number_of_scenes | The number of scenes.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if number_of_scenes is NULL

LO_RESULT LOSketchUpModelGetOutputEntities | ( | LOSketchUpModelRef | model,
|  | LOEntityListRef | entity_list
| ) |  |

Creates the entities that represent the SketchUp model using its output settings and adds them to a LOEntityListRef.

This will use the document's output render mode override setting for SketchUp model viewports, and the raster output image quality set by LOPageInfoSetOutputResolution. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released.

Since
  Layout 2023.1, API 8.1

Parameters

  [in] | model | The SketchUp model object.
  [in] | entity_list | The entity list object to add the new entities to.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `model` does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if `entity_list` does not refer to a valid object

LO_RESULT LOSketchUpModelGetPerspective | ( | LOSketchUpModelRef | model,
|  | bool * | perspective
| ) |  |

Gets whether or not the view is rendered in perspective mode.

Parameters

  [in] | model | The SketchUp model object.
  [out] | perspective | Whether or not the view is rendered in perspective mode.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if perspective is NULL

LO_RESULT LOSketchUpModelGetPreserveScaleOnResize | ( | LOSketchUpModelRef | model,
|  | bool * | preserve_scale
| ) |  |

Gets whether or not the scale is preserved when the SketchUp model is resized.

Parameters

  [in] | model | The SketchUp model object.
  [out] | preserve_scale | True if the scale is preserved on resize.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if preserve_scale is NULL

LO_RESULT LOSketchUpModelGetRenderMode | ( | LOSketchUpModelRef | model,
|  | LOSketchUpModelRenderMode * | render_mode
| ) |  |

Gets the render mode of the SketchUp model.

Parameters

  [in] | model | The SketchUp model object.
  [out] | render_mode | The render mode of the SketchUp model.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if render_mode is NULL

LO_RESULT LOSketchUpModelGetScale | ( | LOSketchUpModelRef | model,
|  | double * | scale
| ) |  |

Gets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode.

Parameters

  [in] | model | The SketchUp model object.
  [out] | scale | The SketchUp model's scale.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if scale is NULL
  - SU_ERROR_NO_DATA if model is currently rendered in perspective mode.

LO_RESULT LOSketchUpModelGetStandardView | ( | LOSketchUpModelRef | model,
|  | LOSketchUpModelStandardView * | view
| ) |  |

Gets the standard view that a SketchUp model is currently set to.

Parameters

  [in] | model | The SketchUp model object.
  [out] | view | The standard view that the SketchUp model is currently set to.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if view is NULL
  - SU_ERROR_NO_DATA if the SketchUp model is not currently set to a standard view

LO_RESULT LOSketchUpModelGetStyleModified | ( | LOSketchUpModelRef | model,
|  | bool * | modified
| ) |  |

Gets whether the SketchUp model's style has been modified.

Parameters

  [in] | model | The SketchUp model object.
  [out] | modified | Indicates whether or not the style has been modified in LayOut.

Since
  LayOut 2020.1, API 5.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if modified is NULL

LO_RESULT LOSketchUpModelIsRenderNeeded | ( | LOSketchUpModelRef | model,
|  | bool * | render_needed
| ) |  |

Gets the status indicating whether the SketchUp model needs to be rendered.

Parameters

  [in] | model | The SketchUp model object.
  [out] | render_needed | True if the SketchUp model needs to be rendered.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if render_needed is NULL

LO_RESULT LOSketchUpModelRelease | ( | LOSketchUpModelRef * | model | ) |

Releases a SketchUp model object. The object will be invalidated if releasing the last reference.

Parameters

  [in] | model | The SketchUp model object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT model is NULL
  - SU_ERROR_INVALID_INPUT *model does not refer to a valid object

LO_RESULT LOSketchUpModelRender | ( | LOSketchUpModelRef | model | ) |

Renders the SketchUp model. If the model belongs to a LODocumentRef, then the render will be performed at the resolution set in document.page_info (see LODocumentRef and LOPageInfoRef). Otherwise, the render will be performed at Low resolution.

Parameters

  [in] | model | The SketchUp model object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelResetCamera | ( | LOSketchUpModelRef | model | ) |

Resets the SketchUp model's camera to the scene's setting.

Parameters

  [in] | model | The SketchUp model object.

Since
  LayOut 2020.1, API 5.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelResetEffects | ( | LOSketchUpModelRef | model | ) |

Resets the SketchUp model's shadow and fog effects to the scene's settings.

Parameters

  [in] | model | The SketchUp model object.

Since
  LayOut 2020.1, API 5.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelResetLayers | ( | LOSketchUpModelRef | model | ) |

Resets the SketchUp model's layers to the scene's setting.

Note
  In SketchUp 2020, SketchUp "layers" were renamed to "tags". For consistency with the SketchUp API, this will continue to refer to "tags" as "layers".

Since
  LayOut 2020.1, API 5.1

Parameters

  [in] | model | The SketchUp model object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelResetStyle | ( | LOSketchUpModelRef | model | ) |

Resets the SketchUp model's style to the scene's setting.

Parameters

  [in] | model | The SketchUp model object.

Since
  LayOut 2020.1, API 5.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelResetViewportOverridesOnModel | ( | LOSketchUpModelRef | model | ) |

Resets the SketchUp model used by this viewport back to its default state.

Note
  This must be done after a corresponding call to LOSketchUpModelSetViewportOverridesOnModel to ensure proper behavior of the SketchUp model when multiple viewports exist using the same SketchUp model reference.

Since
  LayOut 2026.0, API 11.0

Parameters

  [in] | model | The SketchUp model object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `model` does not refer to a valid object

LO_RESULT LOSketchUpModelSetCamera | ( | LOSketchUpModelRef | model,
|  | SUCameraRef | sucamera
| ) |  |

Sets the camera for the viewport.

Note
  Setting the camera will flag the viewport as having a modified camera.

Since
  LayOut 2026.0, API 11.0

Parameters

  [in] | model | The SketchUp model object.
  [in] | sucamera | The camera reference object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `model` does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if `sucamera` does not refer to a valid object

LO_RESULT LOSketchUpModelSetClipMask | ( | LOSketchUpModelRef | model,
|  | LOEntityRef | clip_mask
| ) |  |

Sets the clip mask of the SketchUp model. A clip mask defines a region of the entity that is visible. This allows you to crop with arbitrary shapes. This operation will replace any clip mask that is already assigned to this model. The entity being used must not be already part of a document or group. The clip mask entity must be either a rectangle, ellipse or a path.

Note
  Starting in LayOut 2020.1, API 5.1, clip_mask may be SU_INVALID, which will remove the existing clip mask, if any.

Since
  LayOut 2017, API 2.0

Parameters

  [in] | model | The SketchUp model object.
  [in] | clip_mask | The new clip mask for the SketchUp model.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_GENERIC if clip_mask is already in a document or group
  - SU_ERROR_UNSUPPORTED if clip_mask is not a rectangle, ellipse, or path
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetCurrentScene | ( | LOSketchUpModelRef | model,
|  | size_t | scene_index
| ) |  |

Sets the scene of the SketchUp model.

Parameters

  [in] | model | The SketchUp model object.
  [in] | scene_index | The index of the scene. This is an index into the list of available scenes returned by LOSketchUpModelGetAvailableScenes.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_OUT_OF_RANGE if scene_index is greater than or equal to the number of available scenes.
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetDashScale | ( | LOSketchUpModelRef | model,
|  | double | dash_scale
| ) |  |

Sets the scale for dashes in the SketchUp model. A scale value of 0.0 or lower will "auto" scale the dashes based on the line weight.

Since
  LayOut 2019, API 4.0

Parameters

  [in] | model | The SketchUp model object.
  [in] | dash_scale | Dash scale. A value less than zero will be set to 0.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetDisplayBackground | ( | LOSketchUpModelRef | model,
|  | bool | display_background
| ) |  |

Sets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector.

Parameters

  [in] | model | The SketchUp model object.
  [in] | display_background | True if the background should be displayed.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetLineWeight | ( | LOSketchUpModelRef | model,
|  | double | line_weight
| ) |  |

Sets the line weight in points for the SketchUp model.

Parameters

  [in] | model | The SketchUp model object.
  [in] | line_weight | Line weight in points.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_OUT_OF_RANGE if line_weight is less than 0.01
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetPerspective | ( | LOSketchUpModelRef | model,
|  | bool | perspective
| ) |  |

Sets whether or not the view is rendered in perspective mode.

Parameters

  [in] | model | The SketchUp model object.
  [in] | perspective | Whether or not the view should be rendered in perspective mode.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetPreserveScaleOnResize | ( | LOSketchUpModelRef | model,
|  | bool | preserve_scale
| ) |  |

Sets whether or not the scale is preserved when the SketchUp model is resized.

Parameters

  [in] | model | The SketchUp model object.
  [in] | preserve_scale | True if the scale should be preserved on resize.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetRenderMode | ( | LOSketchUpModelRef | model,
|  | LOSketchUpModelRenderMode | render_mode
| ) |  |

Sets the render mode of the SketchUp model.

Parameters

  [in] | model | The SketchUp model object.
  [in] | render_mode | The new render mode for the SketchUp model.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_OUT_OF_RANGE if the value of render_mode is invalid
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetScale | ( | LOSketchUpModelRef | model,
|  | double | scale
| ) |  |

Sets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode.

Parameters

  [in] | model | The SketchUp model object.
  [in] | scale | The new scale for the SketchUp model.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if model does not refer to a valid object
  - SU_ERROR_GENERIC if model is rendered in perspective mode
  - SU_ERROR_OUT_OF_RANGE if scale is less than 0.0000001
  - SU_ERROR_LAYER_LOCKED if model is on a locked layer
  - SU_ERROR_ENTITY_LOCKED if model is locked

LO_RESULT LOSketchUpModelSetStandardView | ( | LOSketchUpModelRef | model,
|  | LOSketchUpModelStandardView | view
| ) |  |

Sets a SketchUp model to use a standard view.

Parameters

  [in] | model | The SketchUp model object.
  [in] | view | The standard view to use. SU_ERROR_NONE on success SU_ERROR_INVALID_INPUT if model does not refer to a valid object SU_ERROR_LAYER_LOCKED if model is on a locked layer SU_ERROR_ENTITY_LOCKED if model is locked SU_ERROR_OUT_OF_RANGE if view specifies an invalid value

LO_RESULT LOSketchUpModelSetViewportOverridesOnModel | ( | LOSketchUpModelRef | model | ) |

Applies the SketchUp model viewport's overrides on the SketchUp model retrieved by LOSketchUpModelGetModel.

Note
  The SketchUp model must be reset back to its default state by calling LOSketchUpModelResetViewportOverridesOnModel.

Since
  LayOut 2026.0, API 11.0

Parameters

  [in] | model | The SketchUp model object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `model` does not refer to a valid object

LO_EXPORT LOEntityRef LOSketchUpModelToEntity | ( | LOSketchUpModelRef | model | ) |

Converts from a LOSketchUpModelRef to a LOEntityRef. This is essentially an upcast operation.

Parameters

  [in] | model | The SketchUp model object.

Returns
  - The converted LOEntityRef if model is a valid object
  - If not, the returned reference will be invalid