# Why the Ruby script can‘t change the created file‘s measurement unit？

**URL:** <https://forums.sketchup.com/t/why-the-ruby-script-can-t-change-the-created-file-s-measurement-unit/294958>\
**Category:** Ruby API\
**Created:** [October 18, 2024, 9:29pm UTC](https://forums.sketchup.com/t/why-the-ruby-script-can-t-change-the-created-file-s-measurement-unit/294958 "2024-10-18T21:29:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![517309401](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/517309401/32/222453_2.png) [@517309401](https://forums.sketchup.com/u/517309401)\
**Post date:** [October 18, 2024, 9:29pm UTC](https://forums.sketchup.com/t/why-the-ruby-script-can-t-change-the-created-file-s-measurement-unit/294958/1 "2024-10-18T21:29:31Z")

</div>

[01\_Street\_Store.rb](https://forums.sketchup.com/uploads/short-url/2Wg5UXUg2xZHCFjlkEdxCUQp9kV.rb) (2.3 KB)  
Please help me to check（See the file uploaded，which is attached after the message）：Why, when I define the measurement unit of the model created through a Ruby script as meters and the script runs normally without any errors, do I find that the custom model’s measurement unit is still set to the default inches instead of the meters I defined in the script when I open the saved skp model file?

---

<div class="post-metadata">

**Author:** ![sWilliams](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sWilliams](https://forums.sketchup.com/u/sWilliams)\
**Post date:** [October 18, 2024, 9:43pm UTC](https://forums.sketchup.com/t/why-the-ruby-script-can-t-change-the-created-file-s-measurement-unit/294958/2 "2024-10-18T21:43:53Z")

</div>

Internally the Sketchup model database is always in inches. The options that you are changing only effect what a user sees on the screen.

but you may write your code this way

```ruby
# 定义门口位置和尺寸
door_width = 1.0.m # 门宽 (米)
door_height = 2.0.m # 门高 (米)
door_thickness = 0.2.m # 门的厚度 (米)

```

see also:

> **[Class: Numeric](https://ruby.sketchup.com/Numeric.html)**
>
> A number of methods have been added to the Ruby Numeric class to do units conversions.
