# Dimension Size and Font

**URL:** <https://forums.sketchup.com/t/dimension-size-and-font/90630>\
**Category:** Ruby API\
**Created:** [March 11, 2019, 11:32pm UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630 "2019-03-11T23:32:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [March 11, 2019, 11:32pm UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/1 "2019-03-11T23:32:45Z")

</div>

Is there currently no way to set the font and size of linear dimensions created with the API?

If this is the case it is a serious limitation? Are there any successful workarounds?

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [March 11, 2019, 11:42pm UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/2 "2019-03-11T23:42:15Z")

</div>

It appears that when I create dimensions the font and size default to the model settings found in the Model Info tab. Perhaps there is a way to set the overall model dimensioning atttributes within the API?

---

<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:** [March 12, 2019, 1:02am UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/3 "2019-03-12T01:02:03Z")

</div>

> [@medeek](#):
>
> Is there currently no way to set the font and size of linear dimensions created with the API?

Correct, and there never has been via the Ruby API.

> [@medeek](#):
>
> If this is the case it is a serious limitation

Others have agreed and said so, and requested this be added to the Ruby API for many years.

Discussed in these forums in **Feb of 2015** …

> [@Dimension font and height can't be changed?](https://forums.sketchup.com/t/dimension-font-and-height-cant-be-changed/7375):
>
> I was surprised a week ago to find that there was no way to access and change model info settings for dimensions. Now I can’t seem to find anyway of directly changing a new dimension’s font, style (eg bold) or height. I especially like dimension text that is a fixed height inches rather than view dependent points. Is there a workaround that I don’t see?

And again later that year in **November of 2015** …

> [@Set font characteristics for leader text or dimension text](https://forums.sketchup.com/t/set-font-characteristics-for-leader-text-or-dimension-text/17689):
>
> Finally I can set font characteristics for text in 2016. [http://www.sketchup.com/intl/en/developer/docs/ourdoc/view#draw\_text](http://www.sketchup.com/intl/en/developer/docs/ourdoc/view#draw_text) But It only works for screen text and the size can only be defined in points. I still can’t set font characteristics for leader text or dimension text. Dimension text especially should usually be set to a height in units not points as you can in the Model Info window. And I still can’t access or set the defaults in the Model Info window. So this “improvement” is no …

Officially requested in the official issue tracker in February of 2018 …  
(_… although it has been requested and logged long before even 2015._)

> <https://github.com/SketchUp/api-issue-tracker/issues/48>
>
> \# Feature Requests
> 1. Access to Font and Size (Point or Unit).
> 2. Access to i…nstalled Fonts.
> 3. The ability to attach text to any user defined point within a group or component.
> 4. The Bounding Box of the Text itself.

**Note also discussion threads in this category and issue filed specifically for leader text object font access.** (Please search and add comments. _Ask to unlock threads if needed._)

* * *

> [@medeek](#):
>
> It appears that when I create dimensions the font and size default to the model settings found in the Model Info tab. Perhaps there is a way to set the overall model dimensioning atttributes within the API?

Not with the Ruby API. There is actually no [`Sketchup::OptionsProvider`](http://ruby.sketchup.com/Sketchup/OptionsProvider.html) instance yet implemented for the “DimensionOptions” (seen in the Model Info dialog.)

I just logged an issue for this (just in case it’s been overlooked) …

> <https://github.com/SketchUp/api-issue-tracker/issues/224>
>
> \### API Feature Request
> 
> \#### Need \`"DimensionsOptions"\` \[\`Sketchup::OptionsPr…ovider\`\](http://ruby.sketchup.com/Sketchup/OptionsProvider.html) instance to get and set the controls for model wide defaults as seen in the "Dimensions" panel of the \*\*Model Info\*\* dialog.
> 
> C API parity would be a good thing (and it seems the C API functions are more generic than the Ruby methods, and may need less work.) Note that the C API's \`SUDimensionStyleRef\` object does not have any setter functions, only getters.
> 
> \----
> 
> Ref requests to access specific Drawingelement objects ...
> 
> 48 : \[Dimensions Properties, Font and Attachment\](https://github.com/SketchUp/api-issue-tracker/issues/48)
> 
> 47 : \[Text Lables Properties, Font and Attachment\](https://github.com/SketchUp/api-issue-tracker/issues/47)
> 
> 207 : \[View notes could be a subclass of Sketchup::Text\](https://github.com/SketchUp/api-issue-tracker/issues/207)

* * *

The SketchUp C API does actually have these methods to get and set dimension fonts, but last I heard from @thomthom, he said using the C API on a live model was unsafe.

**So I can’t say if there are actually any workarounds.**

---

<div class="post-metadata">

**Author:** ![barry\_milliken\_droid](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/barry_milliken_droid/32/4612_2.png) [@barry\_milliken\_droid](https://forums.sketchup.com/u/barry_milliken_droid)\
**Post date:** [March 12, 2019, 2:47am UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/4 "2019-03-12T02:47:23Z")

</div>

There is an ugly workaround which I think I posted here last year but cannot find it now.  
I used it for variable sized dimension text in my 2DXY SiteSurvey Extension.  
See the first part of this video to see how it works:

[![](https://global.discourse-cdn.com/sketchup/original/3X/5/2/527e5f41bda58bc44555a0471450310eee5f8d82.jpeg "2DXY SiteSurvey 3 0 Advanced Lesson") ](https://www.youtube.com/watch?v=YwuelnlnYfA)

To get this to work I first stored a single dimension with each font size I wanted (30 of them) in separate skp files (version 16 for backward compatibilty). These are in the resources subfolder of the extension. My ruby code decides from the length of the dimension which size text it needs, and inserts the correct skp as a component, which is then exploded and repositioned using the ruby methods supported.

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [February 2, 2024, 4:54am UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/5 "2024-02-02T04:54:05Z")

</div>

Has there been any updates on this recently. I still do not see a way to set the size of my linear dimensions with the Ruby API. This is a very serious limitation which one would think could easily be fixed.

To my knowledge I am still waiting on a solution so I can adjust font and size of dimensions within the API, this is really quite frustrating and annoying that this has not been addressed 5 years later.

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [February 2, 2024, 5:18am UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/6 "2024-02-02T05:18:26Z")

</div>

The workaround, if you can call it that, is to set the default dimension font and size for the model under Model Info. Then the dimensions will be set to these global settings.

---

<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:** [February 2, 2024, 2:27pm UTC](https://forums.sketchup.com/t/dimension-size-and-font/90630/7 "2024-02-02T14:27:07Z")

</div>

> [@medeek](#):
>
> The workaround, if you can call it that, is to set the default dimension font and size for the model under Model Info.

Which would need to be done:

1. With template models (and the font settings not changed afterward as there **still** is no options provider for dimensions.)

2. With the C API by closing the model to be changed, do the change at the file level, and reopening the model.  
(This would likely necessitate a save operation before closing the model in the GUI.)
