LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator 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 <length_formatter.h>

Related Functions

(Note that these are not member functions.)

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

SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT SULengthFormatterRelease ( SULengthFormatterRef formatter)
related

Releases a length formatter object.

Since
SketchUp 2018, API 6.0
Parameters
[in]formatterThe formatter object.
Returns
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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
SU_RESULT 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 file: