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
SULineStyleRef Struct Reference

References a line style. More...

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

Inherits SUEntityRef.

## Related Functions
(Note that these are not member functions.)
SUEntityRef | SULineStyleToEntity (SULineStyleRef line_style)
| Converts from a SULineStyleRef to an SUEntityRef. This is essentially an upcast operation. More...
SULineStyleRef | SULineStyleFromEntity (SUEntityRef entity_ref)
| Converts from an SUEntityRef to a SULineStyleRef. This is essentially a downcast operation so the given entity must be convertible to a SULineStyleRef. More...
enum SUResult | SULineStyleGetName (SULineStyleRef line_style, SUStringRef *name)
| Retrieves the name of a line style object. More...
enum SUResult | SULineStyleGetWidthPixels (SULineStyleRef line_style, double *pixel_width)
| Retrieves the pixel width of a line style. More...
enum SUResult | SULineStyleSetWidthPixels (SULineStyleRef line_style, double pixel_width)
| Sets the pixel width of a line style. Must be greater than 0. More...
enum SUResult | SULineStyleGetLengthMultiplier (SULineStyleRef line_style, double *length_multiplier)
| Retrieves the length multiplier of a line style. This value is used to scale the applied stipple of the line. More...
enum SUResult | SULineStyleSetLengthMultiplier (SULineStyleRef line_style, double length_multiplier)
| Sets the length multiplier of a line style. Must be a non-zero value. Default is 1. This value is used to scale the applied stipple pattern of the line. Positive values will be applied directly (ie a value of 2.0 will stretch the stipple pattern by a factor of 2). Negative values will be divided by the line width such that the final scale equals abs(length_multiplier) / current_line_width. More...
enum SUResult | SULineStyleGetColor (SULineStyleRef line_style, SUColor *color)
| Retrieves the color value of a line style object. More...
enum SUResult | SULineStyleSetColor (SULineStyleRef line_style, const SUColor *color)
| Sets the color of a line style object. More...
enum SUResult | SULineStyleCreateCopy (SULineStyleRef line_style, const char *name, SULineStyleRef *destination)
| Creates a new line style object by copying an existing one. More...
enum SUResult | SULineStyleRelease (SULineStyleRef *line_style)
| Deallocates a line style object. More...
enum SUResult | SULineStyleIsUserCreated (SULineStyleRef line_style, bool *is_user_created)
| Indicates whether the line style object is user created or not. More...
Related Functions inherited from SUEntityRef
enum SURefType | SUEntityGetType (SUEntityRef entity)
| Returns the concrete type of the given entity. More...
enum SUResult | SUEntityGetID (SUEntityRef entity, int32_t *entity_id)
| Retrieves the id of the entity. More...
enum SUResult | SUEntityGetPersistentID (SUEntityRef entity, int64_t *entity_pid)
| Retrieves the persistent id of the entity. More...
enum SUResult | SUEntityGetNumAttributeDictionaries (SUEntityRef entity, size_t *count)
| Retrieves the number of attribute dictionaries of an entity. More...
enum SUResult | SUEntityGetAttributeDictionaries (SUEntityRef entity, size_t len, SUAttributeDictionaryRef dictionaries[], size_t *count)
| Retrieves the attribute dictionaries of an entity. More...
enum SUResult | SUEntityAddAttributeDictionary (SUEntityRef entity, SUAttributeDictionaryRef dictionary)
| Adds the attribute dictionary to an entity. The given dictionary object must not belong to another entity. In other words, each dictionary should be added to one entity only. More...
enum SUResult | SUEntityGetAttributeDictionary (SUEntityRef entity, const char *name, SUAttributeDictionaryRef *dictionary)
| Retrieves the attribute dictionary of an entity that has the given name. More...
enum SUResult | SUEntityGetModel (SUEntityRef entity, SUModelRef *model)
| Retrieves the model object associated with the entity. More...
enum SUResult | SUEntityGetParentEntities (SUEntityRef entity, SUEntitiesRef *entities)
| Retrieves the entities object which contains the entity. More...

## Detailed Description

References a line style.

## Friends And Related Function Documentation

enum SUResult SULineStyleCreateCopy | ( | SULineStyleRef | line_style,
|  | const char * | name,
|  | SULineStyleRef * | destination
| ) |  |
| related

Creates a new line style object by copying an existing one.

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | line_style | The line style object to copy.
  [in] | name | The name to apply to the new line style object.
  [out] | destination | The new line style object that is created.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if name is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if destination is NULL
  - SU_ERROR_OVERWRITE_VALID if destination already references a valid object.

SULineStyleRef SULineStyleFromEntity | ( | SUEntityRef | entity_ref | ) |
| related

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

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | entity_ref | The given entity reference.

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

enum SUResult SULineStyleGetColor | ( | SULineStyleRef | line_style,
|  | SUColor * | color
| ) |  |
| related

Retrieves the color value of a line style object.

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | line_style | The line style object.
  [out] | color | The color value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
  - SU_ERROR_NO_DATA if the line style object does not have a color value

enum SUResult SULineStyleGetLengthMultiplier | ( | SULineStyleRef | line_style,
|  | double * | length_multiplier
| ) |  |
| related

Retrieves the length multiplier of a line style. This value is used to scale the applied stipple of the line.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | line_style | The line style object.
  [out] | length_multiplier | The length multiplier retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if length_multiplier is NULL

enum SUResult SULineStyleGetName | ( | SULineStyleRef | line_style,
|  | SUStringRef * | name
| ) |  |
| related

Retrieves the name of a line style object.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | line_style | The line style object.
  [out] | name | The name retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if name is NULL
  - SU_ERROR_INVALID_OUTPUT if name does not point to a valid SUStringRef object

enum SUResult SULineStyleGetWidthPixels | ( | SULineStyleRef | line_style,
|  | double * | pixel_width
| ) |  |
| related

Retrieves the pixel width of a line style.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | line_style | The line style object.
  [out] | pixel_width | The pixel width retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if pixel_width is NULL

enum SUResult SULineStyleIsUserCreated | ( | SULineStyleRef | line_style,
|  | bool * | is_user_created
| ) |  |
| related

Indicates whether the line style object is user created or not.

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | line_style | The line style object.
  [out] | is_user_created | The boolean value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if is_user_created is NULL

enum SUResult SULineStyleRelease | ( | SULineStyleRef * | line_style | ) |
| related

Deallocates a line style object.

The line style object to be deallocated must not be associated with a line style manager.

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | line_style | The line style object to release.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if line_style is NULL
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_INVALID_OPERATION if line_style is not a user created style

enum SUResult SULineStyleSetColor | ( | SULineStyleRef | line_style,
|  | const SUColor * | color
| ) |  |
| related

Sets the color of a line style object.

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | line_style | The line style object.
  [in] | color | The color value to set the line style color.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if color is NULL
  - SU_ERROR_INVALID_OPERATION if line_style is a built-in style

enum SUResult SULineStyleSetLengthMultiplier | ( | SULineStyleRef | line_style,
|  | double | length_multiplier
| ) |  |
| related

Sets the length multiplier of a line style. Must be a non-zero value. Default is 1. This value is used to scale the applied stipple pattern of the line. Positive values will be applied directly (ie a value of 2.0 will stretch the stipple pattern by a factor of 2). Negative values will be divided by the line width such that the final scale equals abs(length_multiplier) / current_line_width.

Note
  The restrictions on length_multiplier were relaxed in SketchUp 2020.2, API 8.2 from requiring that length_multiplier be a positive value to requiring that length_multiplier be non-zero.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | line_style | The line style object.
  [in] | length_multiplier | The new length multiplier of the line style.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_OUT_OF_RANGE if length_multiplier is equal to zero
  - SU_ERROR_INVALID_OPERATION if line_style is a built-in style

enum SUResult SULineStyleSetWidthPixels | ( | SULineStyleRef | line_style,
|  | double | pixel_width
| ) |  |
| related

Sets the pixel width of a line style. Must be greater than 0.

Note
  The restrictions on pixel_width were relaxed in SketchUp 2020.2, API 8.2 from requiring that pixel_width be greater than or equal to one to requiring that it be greater than zero.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | line_style | The line style object.
  [in] | pixel_width | The new pixel width of the line style.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if line_style is not a valid object
  - SU_ERROR_OUT_OF_RANGE if pixel_width is less than or equal to 0.0
  - SU_ERROR_INVALID_OPERATION if line_style is a built-in style

SUEntityRef SULineStyleToEntity | ( | SULineStyleRef | line_style | ) |
| related

Converts from a SULineStyleRef to an SUEntityRef. This is essentially an upcast operation.

Since
  SketchUp 2020.1, API 8.1

Parameters

  [in] | line_style | The given line style reference.

Returns
  - The converted SUEntityRef if line_style is a valid line style
  - If not, the returned reference will be invalid

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

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/line_style.h