# Create Label in LayOut with Ruby

**URL:** <https://forums.sketchup.com/t/create-label-in-layout-with-ruby/126378>\
**Category:** Ruby API\
**Created:** [May 24, 2020, 8:52am UTC](https://forums.sketchup.com/t/create-label-in-layout-with-ruby/126378 "2020-05-24T08:52:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis\_bolomier](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/denis_bolomier/32/1580_2.png) [@denis\_bolomier](https://forums.sketchup.com/u/denis_bolomier)\
**Post date:** [May 24, 2020, 8:52am UTC](https://forums.sketchup.com/t/create-label-in-layout-with-ruby/126378/1 "2020-05-24T08:52:19Z")

</div>

Hi, i’m trying to use Layout API for the first time.  
I try to add a circle around label. but I don’t understand how label position works.  
Bounds of label aren’t clear for me.

I use the 2 methods to set label position to workaround bounds but unsuccessfully

On more strange things is when I open the Layout file, and clic on the label, the position change.

 ![label_onlayout](https://global.discourse-cdn.com/sketchup/original/3X/c/4/c431512aec6075635303ce768d3efee90b724ee4.gif)

If you can explain me, whats is bounds of the label and how work ( any tutorial ?)

Please find attached my current code  
[layout.rb](https://forums.sketchup.com/uploads/short-url/sVrvZEgXHZEYBZJhYPb5B3uPRai.rb) (3,9 Ko)

[zertzert émail .layout](https://forums.sketchup.com/uploads/short-url/7A5a93guAlKn8IREupdO1IzC180.layout) (3,8 Mo)

Last info : i’m using sketchup 2020.1 on Mac Os Catalina 10.15.4

---

<div class="post-metadata">

**Author:** ![denis\_bolomier](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/denis_bolomier/32/1580_2.png) [@denis\_bolomier](https://forums.sketchup.com/u/denis_bolomier)\
**Post date:** [May 27, 2020, 1:06pm UTC](https://forums.sketchup.com/t/create-label-in-layout-with-ruby/126378/2 "2020-05-27T13:06:47Z")

</div>

Hi all,

I answer to myself maybe if some-else is interest by creating lable with Layout API.  
Its really hard to explain it even in french, I produce a layout with the code and the result

In resume: the bound of the label is offset depending of the connection\_type.

I enclosed the layout and the pdf file.  
[test.layout](https://forums.sketchup.com/uploads/short-url/tn91qws5peFbGXu94ZkgP0DD4Z1.layout) (74,0 Ko) [test.pdf](https://forums.sketchup.com/uploads/short-url/3ioD4Ro0SzxqTsflMvqJJ5uMzS1.pdf) (118,4 Ko)
