# Reading Drawing Scale (or Units)

**URL:** <https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783>\
**Category:** SketchUp SDK\
**Tags:** scaling, model\_units\
**Created:** [November 9, 2020, 5:40pm UTC](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783 "2020-11-09T17:40:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard8](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@Richard8](https://forums.sketchup.com/u/Richard8)\
**Post date:** [November 9, 2020, 5:40pm UTC](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783/1 "2020-11-09T17:40:43Z")

</div>

(SketchUp C API)

I have implemented a SketchUp “SKP” file importer for our 3D modelling package, and have discovered that the imported scale is _usually_ correct but is sometimes very wrong.

SUModelGetUnits() returns SUModelUnits\_Meters for every model I have tested, and the vast majority of models are imported correctly if I accept this value and use a global scale factor of 1 skp unit == 1 metre.

However, our users have discovered that a small number of SketchUp models are in fact 1 unit == 1 inch.

I have not been able to determine any distinguishing features of these ‘inch’ models.

In all these models, SUModelGetUnits() returns SUModelUnits\_Meters, and the “UnitsOptions” SUOptionsProvider returns 0 (Decimal) for LengthFormat and 4 (Metres) for LengthUnit.

It doesn’t matter whether the model is really metres or really inches, I get the exact same results from these calls.

How do I read the **actual** size of unit that is being used?

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [November 9, 2020, 6:43pm UTC](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783/2 "2020-11-09T18:43:07Z")

</div>

> [@Richard8](#):
>
> It doesn’t matter whether the model is really metres or really inches, I get the exact same results from these calls.

The SketchUp application, and all it’s APIs internally uses inches for lengths and coordinates.

---

<div class="post-metadata">

**Author:** ![Richard8](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@Richard8](https://forums.sketchup.com/u/Richard8)\
**Post date:** [November 10, 2020, 10:29am UTC](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783/3 "2020-11-10T10:29:29Z")

</div>

Thanks. That is a very… shall we say “surprising” decision.

It’s not very well documented in the SDK, I didn’t find that mentioned anywhere, though I assume it must be somewhere.

I would certainly expect the actual units to be documented on the [SUPoint3D](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_point3_d.html) page.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [November 10, 2020, 5:16pm UTC](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783/4 "2020-11-10T17:16:11Z")

</div>

> [@Richard8](#):
>
> It’s not very well documented in the SDK, I didn’t find that mentioned anywhere, though I assume it must be somewhere.

I agree. It **is** documented in the SketchUp **Ruby** API dictionary, in the **Overview** for the **[`Length`](https://ruby.sketchup.com/Length.html)** class. _viz:_

> _Internally, all lengths in SketchUp are stored in inches. The Length class stores values in inches as well. A number of methods have been added to the Ruby Numeric class to do units conversions._

The SketchUp Ruby API came many years before the C API, so it’s documentation is more robust.

> [@Richard8](#):
>
> I would certainly expect the actual units to be documented on the [SUPoint3D](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_point3_d.html) page.

I agree that the description for the **coordinates** , **magnitudes** , **length** , **area** , and **volume** values, should explain that they are in inches (and that the internal tolerance is 0.001".)

I opened an API Documentation Parity Issue for the C API in this regard.

> <https://github.com/SketchUp/api-issue-tracker/issues/563>
>
> \#### SketchUp C API Documentation Issue
> 
> 
> ISSUE: The C API does not indicate …anywhere that SketchUp internal geometric values (and those stored in \*\*.skp\*\* and \*\*.layout\*\* file formats,) for \*\*length\*\*, \*\*area\*\* and \*\*volume\*\* are in \*\*inches\*\*.
> 
> This causes problems for C API users unfamiliar with SketchUp and/or it's Ruby API.
> 
> REF Public forum thread: \[Reading Drawing Scale (or Units)\](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783)
> 
> \----
> 
> The description for the coordinates and magnitudes should have an additional ..."\`in inches.\`" for geometry structs:
> \* \[\`SUPoint2D\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_point2\_d.html)
> \* \[\`SUPoint3D\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_point3\_d.html)
> \* \[\`SUVector2D\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_vector2\_d.html)
> \* \[\`SUVector3D\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_vector3\_d.html)
> \* \[\`SUUVQ\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_u\_v\_q.html)
> 
> Certain submatrix values (ie, \*\*not\*\* the \*\*scale\*\* value) for:
> \* \[\`SUTransformation\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_transformation.html)
> \* \[\`SUTransformation2D\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_transformation2\_d.html)
> 
> 
> Possibly the factors for the \[\`SUPlane3D\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_plane3\_d.html) equation.
> 
> And in several places should explain SketchUp uses inches internally for \*\*length\*\*, \*\*area\*\*, and \*\*volume\*\* values, as well as storing such values in the SKP file format (and that the internal tolerance is 0.001".)
> 
> Good places for this note (or link to it) might be:
> 
> \* the \[Main\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/index.html) API introductory page (perhaps a \*\*Units\*\* section?)
> \* \[\`SUEntitiesFill()\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_entities\_ref.html#a4c5230af9513a52f80ea9c7fdcf37a22) function
> \* \[\`SUGeometryInputRef\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_geometry\_input\_ref.html)
> \* \[\`SULengthFormatterRef\`\](https://extensions.sketchup.com/developers/sketchup\_c\_api/sketchup/struct\_s\_u\_length\_formatter\_ref.html)
> 
> ~
