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

References a length formatter object. Length formatters are used to generate formatted strings (optionally with units) from length, area, and volume values. Additionally length formatters can be used to translate a formatted length/area/volume string into a value. Accessors and setters are exposed for some of the key formatting properties, facilitating customization of the formater. In cases when users want the formatter to reflect the properties of a model, SUModelGetLengthFormatter should be used to more efficiently extract/copy the relevant properties from the model to the formatter. More...

#include <SketchUpAPI/length_formatter.h>

Related Functions

(Note that these are not member functions.)

enum SUResult SULengthFormatterCreate (SULengthFormatterRef *formatter)
 Creates a new length formatter with default properties. More...
 
enum SUResult SULengthFormatterRelease (SULengthFormatterRef *formatter)
 Releases a length formatter object. More...
 
enum SUResult SULengthFormatterGetPrecision (SULengthFormatterRef formatter, size_t *precision)
 Retrieves the precision of a length formatter. More...
 
enum SUResult SULengthFormatterSetPrecision (SULengthFormatterRef formatter, size_t precision)
 Sets the precision of a length formatter. More...
 
enum SUResult SULengthFormatterGetAreaPrecision (SULengthFormatterRef formatter, size_t *precision)
 Retrieves the area precision of a length formatter. More...
 
enum SUResult SULengthFormatterSetAreaPrecision (SULengthFormatterRef formatter, size_t precision)
 Sets the area precision of a length formatter. More...
 
enum SUResult SULengthFormatterGetVolumePrecision (SULengthFormatterRef formatter, size_t *precision)
 Retrieves the volume precision of a length formatter. More...
 
enum SUResult SULengthFormatterSetVolumePrecision (SULengthFormatterRef formatter, size_t precision)
 Sets the volume precision of a length formatter. More...
 
enum SUResult SULengthFormatterGetFormat (SULengthFormatterRef formatter, enum SULengthFormatType *format)
 Retrieves the format of a length formatter. More...
 
enum SUResult SULengthFormatterSetFormat (SULengthFormatterRef formatter, enum SULengthFormatType format)
 Sets the format of a length formatter. More...
 
enum SUResult SULengthFormatterGetUnits (SULengthFormatterRef formatter, enum SULengthUnitType *units)
 Retrieves the units of a length formatter. More...
 
enum SUResult SULengthFormatterGetAreaUnits (SULengthFormatterRef formatter, enum SUAreaUnitType *units)
 Retrieves the area units of a length formatter. More...
 
enum SUResult SULengthFormatterGetVolumeUnits (SULengthFormatterRef formatter, enum SUVolumeUnitType *units)
 Retrieves the volume units of a length formatter. More...
 
enum SUResult SULengthFormatterSetUnits (SULengthFormatterRef formatter, enum SULengthUnitType units)
 Sets the units of a length formatter. More...
 
enum SUResult SULengthFormatterSetAreaUnits (SULengthFormatterRef formatter, enum SUAreaUnitType units)
 Sets the area units of a length formatter. More...
 
enum SUResult SULengthFormatterSetVolumeUnits (SULengthFormatterRef formatter, enum SUVolumeUnitType units)
 Sets the volume units of a length formatter. More...
 
enum SUResult SULengthFormatterGetSuppressUnits (SULengthFormatterRef formatter, bool *suppress)
 Retrieves whether units are suppressed. More...
 
enum SUResult SULengthFormatterSetSuppressUnits (SULengthFormatterRef formatter, bool suppress)
 Sets whether units are suppressed. More...
 
enum SUResult SULengthFormatterGetLengthString (SULengthFormatterRef formatter, double length, bool strip, SUStringRef *string)
 Retrieves a formatted length string from the provided length value. More...
 
enum SUResult SULengthFormatterGetAreaString (SULengthFormatterRef formatter, double area, SUStringRef *string)
 Retrieves a formatted area string from the provided area value. More...
 
enum SUResult SULengthFormatterGetVolumeString (SULengthFormatterRef formatter, double volume, SUStringRef *string)
 Retrieves a formatted volume string from the provided volume value. More...
 
enum SUResult SULengthFormatterParseString (SULengthFormatterRef formatter, SUStringRef string, double *value)
 Parses a formatted length string getting the numeric value. More...
 
enum SUResult SULengthFormatterSetForceInchDisplay (SULengthFormatterRef formatter, bool force_inch)
 Force the display of Architectural inches even if the value is zero. More...
 
enum SUResult SULengthFormatterGetForceInchDisplay (SULengthFormatterRef formatter, bool *force_inch)
 Determine if Architectural inches will display even if the value is zero. More...
 

Detailed Description

References a length formatter object. Length formatters are used to generate formatted strings (optionally with units) from length, area, and volume values. Additionally length formatters can be used to translate a formatted length/area/volume string into a value. Accessors and setters are exposed for some of the key formatting properties, facilitating customization of the formater. In cases when users want the formatter to reflect the properties of a model, SUModelGetLengthFormatter should be used to more efficiently extract/copy the relevant properties from the model to the formatter.

Since
SketchUp 2018, API 6.0

Friends And Related Function Documentation

enum SUResult SULengthFormatterCreate ( SULengthFormatterRef formatter)
related

Creates a new length formatter with default properties.

Since
SketchUp 2018, API 6.0
Parameters
[out]formatterThe formatter object created.
Returns
enum SUResult SULengthFormatterGetAreaPrecision ( SULengthFormatterRef  formatter,
size_t *  precision 
)
related

Retrieves the area precision of a length formatter.

Since
Sketchup 2020, API 8.0
Parameters
[in]formatterThe formatter object.
[out]precisionThe precision retrieved.
Returns
enum SUResult SULengthFormatterGetAreaString ( SULengthFormatterRef  formatter,
double  area,
SUStringRef string 
)
related

Retrieves a formatted area string from the provided area value.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]areaThe area value.
[out]stringThe formatted string retrieved.
Returns
enum SUResult SULengthFormatterGetAreaUnits ( SULengthFormatterRef  formatter,
enum SUAreaUnitType units 
)
related

Retrieves the area units of a length formatter.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]formatterThe formatter object.
[out]unitsThe unit type retrieved.
Returns
enum SUResult SULengthFormatterGetForceInchDisplay ( SULengthFormatterRef  formatter,
bool *  force_inch 
)
related

Determine if Architectural inches will display even if the value is zero.

Since
SketchUp 2019, API 7.0
Parameters
[in]formatterThe formatter object.
[out]force_inchThe boolean value to force inch display.
Returns
enum SUResult SULengthFormatterGetFormat ( SULengthFormatterRef  formatter,
enum SULengthFormatType format 
)
related

Retrieves the format of a length formatter.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[out]formatThe format retrieved.
Returns
enum SUResult SULengthFormatterGetLengthString ( SULengthFormatterRef  formatter,
double  length,
bool  strip,
SUStringRef string 
)
related

Retrieves a formatted length string from the provided length value.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]lengthThe length value.
[in]stripWhether to strip trailing zeros, leading ~, and decimal point if it is the last character.
[out]stringThe formatted string retrieved.
Returns
enum SUResult SULengthFormatterGetPrecision ( SULengthFormatterRef  formatter,
size_t *  precision 
)
related

Retrieves the precision of a length formatter.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[out]precisionThe precision retrieved.
Returns
enum SUResult SULengthFormatterGetSuppressUnits ( SULengthFormatterRef  formatter,
bool *  suppress 
)
related

Retrieves whether units are suppressed.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[out]suppressThe unit suppression flag retrieved.
Returns
enum SUResult SULengthFormatterGetUnits ( SULengthFormatterRef  formatter,
enum SULengthUnitType units 
)
related

Retrieves the units of a length formatter.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[out]unitsThe unit type retrieved.
Returns
enum SUResult SULengthFormatterGetVolumePrecision ( SULengthFormatterRef  formatter,
size_t *  precision 
)
related

Retrieves the volume precision of a length formatter.

Since
Sketchup 2020, API 8.0
Parameters
[in]formatterThe formatter object.
[out]precisionThe precision retrieved.
Returns
enum SUResult SULengthFormatterGetVolumeString ( SULengthFormatterRef  formatter,
double  volume,
SUStringRef string 
)
related

Retrieves a formatted volume string from the provided volume value.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]volumeThe volume value.
[out]stringThe formatted string retrieved.
Returns
enum SUResult SULengthFormatterGetVolumeUnits ( SULengthFormatterRef  formatter,
enum SUVolumeUnitType units 
)
related

Retrieves the volume units of a length formatter.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]formatterThe formatter object.
[out]unitsThe unit type retrieved.
Returns
enum SUResult SULengthFormatterParseString ( SULengthFormatterRef  formatter,
SUStringRef  string,
double *  value 
)
related

Parses a formatted length string getting the numeric value.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]stringThe formatted string.
[out]valueThe numeric value retrieved.
Returns
enum SUResult SULengthFormatterRelease ( SULengthFormatterRef formatter)
related

Releases a length formatter object.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
Returns
enum SUResult SULengthFormatterSetAreaPrecision ( SULengthFormatterRef  formatter,
size_t  precision 
)
related

Sets the area precision of a length formatter.

Since
Sketchup 2020, API 8.0
Parameters
[in]formatterThe formatter object.
[in]precisionThe precision to be set.
Returns
enum SUResult SULengthFormatterSetAreaUnits ( SULengthFormatterRef  formatter,
enum SUAreaUnitType  units 
)
related

Sets the area units of a length formatter.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]formatterThe formatter object.
[in]unitsThe unit type to be set.
Returns
enum SUResult SULengthFormatterSetForceInchDisplay ( SULengthFormatterRef  formatter,
bool  force_inch 
)
related

Force the display of Architectural inches even if the value is zero.

Since
SketchUp 2019, API 7.0
Parameters
[in]formatterThe formatter object.
[in]force_inchThe boolean value to force inch display.
Returns
enum SUResult SULengthFormatterSetFormat ( SULengthFormatterRef  formatter,
enum SULengthFormatType  format 
)
related

Sets the format of a length formatter.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]formatThe format to be set.
Returns
enum SUResult SULengthFormatterSetPrecision ( SULengthFormatterRef  formatter,
size_t  precision 
)
related

Sets the precision of a length formatter.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]precisionThe precision to be set.
Returns
enum SUResult SULengthFormatterSetSuppressUnits ( SULengthFormatterRef  formatter,
bool  suppress 
)
related

Sets whether units are suppressed.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]suppressThe unit suppression flag to be set.
Returns
enum SUResult SULengthFormatterSetUnits ( SULengthFormatterRef  formatter,
enum SULengthUnitType  units 
)
related

Sets the units of a length formatter.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
[in]unitsThe unit type to be set.
Returns
enum SUResult SULengthFormatterSetVolumePrecision ( SULengthFormatterRef  formatter,
size_t  precision 
)
related

Sets the volume precision of a length formatter.

Since
Sketchup 2020, API 8.0
Parameters
[in]formatterThe formatter object.
[in]precisionThe precision to be set.
Returns
enum SUResult SULengthFormatterSetVolumeUnits ( SULengthFormatterRef  formatter,
enum SUVolumeUnitType  units 
)
related

Sets the volume units of a length formatter.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]formatterThe formatter object.
[in]unitsThe unit type to be set.
Returns

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