# Layout Ruby API

**URL:** <https://forums.sketchup.com/t/layout-ruby-api/78831>\
**Category:** Ruby API\
**Tags:** layoutapi\
**Created:** [October 11, 2018, 3:27pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831 "2018-10-11T15:27:03Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [October 11, 2018, 3:27pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/1 "2018-10-11T15:27:04Z")

</div>

Breaking this into a new topic to keep from getting off topic.

> [@Medeek Wall](https://forums.sketchup.com/t/medeek-wall/40364/540):
>
> As I’m even more a neophyte on Ruby Scripting than I am for Layout, I have to ask:  
> Can one, through Ruby scripting, CREATE visible Dynamic Component attributes?

The Layout Ruby API is only available in Layout 2018. The SketchUp model in shown on the Layout page can be accessed from the Layout API. However ‘nothing’ can be done with the SketchUp model.

By nothing I mean that the SketchUp entities can’t be referenced (dynamic components, etc.)

> **[Class: Layout::SketchUpModel](https://ruby.sketchup.com/Layout/SketchUpModel.html)**
>
> A SketchUp Model entity.

I also haven’t figured out how to attach layout dimension leaders to a point in the model using the API.  
For example if I dimension the width of a building in layout, the dimension moves with the model and stays connected. Perhaps this is still not possible using the API? @thomthom

 ![Layout%20Dimensions1](https://global.discourse-cdn.com/sketchup/original/3X/f/7/f7019be1f9de3d4dbc06e103d36e60448b47b43a.gif)

> [@Medeek Wall](https://forums.sketchup.com/t/medeek-wall/40364/539):
>
> LayOut can only see attributes that are set to visible in Dynamic Components.  
> Until the live API…

I couldn’t see any way to get Dynamic Component info in Layout. Can you elaborate?

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [October 11, 2018, 3:57pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/2 "2018-10-11T15:57:08Z")

</div>

It is in the label tool and since version 2018, you can ‘see’ the advanced attributes as well:

 ![dynamicattribute](https://global.discourse-cdn.com/sketchup/original/3X/0/8/088d746d4848d7d40a9943836a92c80433096b24.gif)

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [October 11, 2018, 4:17pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/3 "2018-10-11T16:17:19Z")

</div>

Neat! I’ll have to try that.  
It doesn’t seem like that info can be accessed from the API though?

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [October 11, 2018, 4:35pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/4 "2018-10-11T16:35:20Z")

</div>

yes it can, but for now, only in SketchUp, the library is called dynamic\_components

 ![image](https://global.discourse-cdn.com/sketchup/original/3X/f/a/fa28818483287915bb8017f70c309cf87ef9e1df.jpeg)

---

<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:** [October 11, 2018, 5:18pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/5 "2018-10-11T17:18:14Z")

</div>

> [@Neil\_Burkholder](#):
>
> The Layout Ruby API is only available in Layout 2018.

Incorrect. It is available (at this time) only within **SketchUp 2018**.

> [@Neil\_Burkholder](#):
>
> The SketchUp model in shown on the Layout page can be accessed from the Layout API. However ‘nothing’ can be done with the SketchUp model.

To manipulate the model, you may need to load it into SketchUp. To update in the LayOut document, you may need to save the it’s bounds etc. and recreate it again, after having saved the modified SKP file.

> [@Neil\_Burkholder](#):
>
> I also haven’t figured out how to attach layout dimension leaders to a point in the model using the API.

_Read example given for class …_

> **[Class: Layout::ConnectionPoint](https://ruby.sketchup.com/Layout/ConnectionPoint.html)**
>
> This is the interface to a LayOut Connection Point.

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [October 11, 2018, 6:26pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/6 "2018-10-11T18:26:27Z")

</div>

> [@DanRathbun](#):
>
> Incorrect. It is available (at this time) only within **SketchUp 2018**.

I was mistaken the Layout API is accessible only from within SketchUp.

> [@DanRathbun](#):
>
> Read example given for class …

OK my problem was I was looking at the `Layout::LinearDimension.start_connection_point` which only accepts a 2D point. Specifying a ConnectionPoint will generate an error.

```ruby
Error: Cannot convert argument to Geom::Point2d

```

> **[Class: Layout::LinearDimension](https://ruby.sketchup.com/Layout/LinearDimension.html#start_connection_point=-instance_method)**
>
> References a linear dimension entity.

I did find that a `Layout::ConnectionPoint` can be provided to the `Layout::LinearDimension.connect` method though.

That is what I was looking for.

---

<div class="post-metadata">

**Author:** ![slbaumgartner](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/slbaumgartner/32/7302_2.png) [@slbaumgartner](https://forums.sketchup.com/u/slbaumgartner)\
**Post date:** [October 11, 2018, 9:09pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/7 "2018-10-11T21:09:44Z")

</div>

> [@Neil\_Burkholder](#):
>
> There is a ruby console in Layout that can access object using the [Layout API](https://ruby.sketchup.com/Layout.html)

Really? This is news to me. How does one access it?

---

<div class="post-metadata">

**Author:** ![john\_drivenupthewall](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@john\_drivenupthewall](https://forums.sketchup.com/u/john_drivenupthewall)\
**Post date:** [October 11, 2018, 9:10pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/8 "2018-10-11T21:10:51Z")

</div>

we shouldn’t talk about fight club…

john

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [October 11, 2018, 11:19pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/10 "2018-10-11T23:19:07Z")

</div>

> [@slbaumgartner](#):
>
> Really? This is news to me. How does one access it?

Hmm… I must have been dreaming. Too much coffee (or not enough)!

---

<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:** [October 12, 2018, 2:32pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/11 "2018-10-12T14:32:38Z")

</div>

> [@Neil\_Burkholder](#):
>
> I did find that a `Layout::ConnectionPoint` can be provided to the `Layout::LinearDimension.connect` method though. That is what I was looking for.

Yup, as shown in the example I linked for ya’. It is a bit weird. You first draw it as a 2D paperspace object, then “connect” it to the 3D modelspace.

---

<div class="post-metadata">

**Author:** ![donneyclark](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/donneyclark/32/62972_2.png) [@donneyclark](https://forums.sketchup.com/u/donneyclark)\
**Post date:** [January 10, 2019, 6:32pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/12 "2019-01-10T18:32:56Z")

</div>

Is there a discussion somewhere about LayOut ruby script(s) that can complement and/or supplement the capabilities of the Medeek BIM extensions?

---

<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:** [January 10, 2019, 11:11pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/13 "2019-01-10T23:11:16Z")

</div>

**Right here**. You’ve found it (or it was grafted here to it by admins.)

---

<div class="post-metadata">

**Author:** ![donneyclark](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/donneyclark/32/62972_2.png) [@donneyclark](https://forums.sketchup.com/u/donneyclark)\
**Post date:** [January 11, 2019, 4:17pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/14 "2019-01-11T16:17:08Z")

</div>

For about a year, I have considered using the ConDoc Tools. But, it seems like this extension is better geared for AIA Architectural Graphic Standards. I am not an architect nor do I work for an architectural firm, so AIA standards are most likely beyond what I need.  
Next week, I have a meeting with the drafting instructor at the local community college to discuss ANSI and ISO drafting standards for construction documents. Info online about ANSI drafting standards only covers mechanical drafting.

Added context: I have been learning the Medeek plugins for only a few months now.

(Disclaimer: I am hesitate in utilizing forums because I am NOT a strong reading.)

---

<div class="post-metadata">

**Author:** ![donneyclark](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/donneyclark/32/62972_2.png) [@donneyclark](https://forums.sketchup.com/u/donneyclark)\
**Post date:** [January 11, 2019, 4:23pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/15 "2019-01-11T16:23:34Z")

</div>

I am new to this forum; I started my account yesterday. Admins have moved one of my posts, but I was able to place my question above within the correct thread from the start.

---

<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:** [January 11, 2019, 11:55pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/16 "2019-01-11T23:55:20Z")

</div>

> [@donneyclark](#):
>
> Info online about ANSI drafting standards only covers mechanical drafting.

ANSI is defunct (I believe.) Any of the old standards sill in use have been adopted by other professional associations.

For example, ANSI Y14.100 (replaced MIL-STD-100) and is now  
**ASME Y14.100** having been updated as late as 2004 …

> **[Y14.100 - Engineering Drawing Practices | ASME - ASME](https://www.asme.org/codes-standards/find-codes-standards/y14-100-engineering-drawing-practices)**
>
> ASME Y14.100 provides requirements & reference documents applicable to the preparation & revision of manual or computer generated engineering drawings & associated lists.

The ASME adopted most of the old Y14 series of standards from ANSI. So you’ll have better luck searching using `"ASME Y14.{number}"` than `"ANSI Y14.{number}"`.

You might find free PDF editions available through collegiate online libraries. For example here is one …

[https://www.noao.edu/ets/Mechanical/Policies/ANSI%20Y14.24M-1989.pdf](https://www.noao.edu/ets/Mechanical/Policies/ANSI%20Y14.24M-1989.pdf)

* * *

**For Architectural try …**

[https://www.nationalcadstandard.org/](https://www.nationalcadstandard.org/)

[https://www.iso.org/ics/01.100.30/x/](https://www.iso.org/ics/01.100.30/x/)

… and another starting point …

> **[Architectural drawing](https://en.wikipedia.org/wiki/Architectural_drawing)**
>
> An architectural drawing or architect's drawing is a technical drawing of a building (or building project) that falls within the definition of architecture. Architectural drawings are used by architects and others for a number of purposes: to develop a design idea into a coherent proposal, to communicate ideas and concepts, to convince clients of the merits of a design, to assist a building contractor to construct it based on design intent, as a record of the design and planned development, or to...

---

<div class="post-metadata">

**Author:** ![donneyclark](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/donneyclark/32/62972_2.png) [@donneyclark](https://forums.sketchup.com/u/donneyclark)\
**Post date:** [January 14, 2019, 6:24pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/17 "2019-01-14T18:24:06Z")

</div>

Dan, thank you for the info and links!!

The local drafting instructor only has outdated AIA books. He has lent me his 1989 AIA Architectural Graphic Standards Student Edition book. He does have a 2000 regular edition, but I am thinking that the student edition would be better for me.

---

<div class="post-metadata">

**Author:** ![donneyclark](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/donneyclark/32/62972_2.png) [@donneyclark](https://forums.sketchup.com/u/donneyclark)\
**Post date:** [January 14, 2019, 9:15pm UTC](https://forums.sketchup.com/t/layout-ruby-api/78831/18 "2019-01-14T21:15:07Z")

</div>

ANSI/ASME paper sizes vs ARCH paper sizes. (ARCH sizes from AIA?) A construction company should use ARCH paper sizes for construction document drawings?  
(Please move this comment to the appropriate thread if need be.)
