# Get Section location

**URL:** <https://forum.dynamobim.com/t/get-section-location/757>\
**Category:** Packages\
**Created:** [November 27, 2014, 2:53am UTC](https://forum.dynamobim.com/t/get-section-location/757 "2014-11-27T02:53:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Holth](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thomas\_Holth](https://forum.dynamobim.com/u/Thomas_Holth)\
**Post date:** [November 27, 2014, 2:53am UTC](https://forum.dynamobim.com/t/get-section-location/757/1 "2014-11-27T02:53:37Z")

</div>

Hi

Is it possible to get the location, direction or bounding box of a section element through the API? I’m having problems with that.

Thomas

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [November 27, 2014, 5:27am UTC](https://forum.dynamobim.com/t/get-section-location/757/2 "2014-11-27T05:27:25Z")

</div>

Seems like the API call for the direction is “.ViewDirection”:

![2014-11-27_184948](http://dynamobim.com/wp-content/uploads/forum-assets/dimiter_vmail-bg/11/27/2014-11-27_184948-300x118.jpg)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

I’m not sure how to extract the the bounding box tho.

[SectDir-test](http://dynamobim.com/wp-content/uploads/forum-assets/dimiter_vmail-bg/11/27/SectDir-test.dyn)

---

<div class="post-metadata">

**Author:** ![Thomas\_Holth](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thomas\_Holth](https://forum.dynamobim.com/u/Thomas_Holth)\
**Post date:** [November 27, 2014, 5:31am UTC](https://forum.dynamobim.com/t/get-section-location/757/3 "2014-11-27T05:31:16Z")

</div>

Ok, thanks. That is perfect. I’ll only need something to pinpoint the direction of the section. I tried .Location, .RightDirection and .BoundingBox, but none of them gave any geometry I could use as far as I could see.

Thomas

---

<div class="post-metadata">

**Author:** ![Thomas\_Holth](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thomas\_Holth](https://forum.dynamobim.com/u/Thomas_Holth)\
**Post date:** [December 1, 2014, 2:46am UTC](https://forum.dynamobim.com/t/get-section-location/757/4 "2014-12-01T02:46:20Z")

</div>

Hi

Is it possible to do this with the “Select Element” node too? This node returns an Elements, but .ViewDirection is a property of the ViewSection class, not the Element class. Do I have to convert the Element object to a ViewSection object first? How do I do that? I can use a FilteredElementCollector to get all views and then filter out the view with the ID of the selected element, but is there a simpler/better method??

Thomas

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [December 1, 2014, 5:30am UTC](https://forum.dynamobim.com/t/get-section-location/757/5 "2014-12-01T05:30:46Z")

</div>

You can actually use a trick to derive the view ID. Because once you draw the section, the line that represents the section and the actual view are created in the same transaction, one after the other and therefore their IDs are assigned sequentially. So if you select the section line, read its ID and add 1, you can select the view like so:

![2014-12-01_175620](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/9/915d06bceaef419994db666939a4a8423c02c54a.jpg)

&nbsp;

&nbsp;

&nbsp;

I learned that trick from Julien.

---

<div class="post-metadata">

**Author:** ![Thomas\_Holth](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thomas\_Holth](https://forum.dynamobim.com/u/Thomas_Holth)\
**Post date:** [December 4, 2014, 2:12am UTC](https://forum.dynamobim.com/t/get-section-location/757/6 "2014-12-04T02:12:34Z")

</div>

Hi

That’s a clever trick. Thank you very much.

---

<div class="post-metadata">

**Author:** ![fluffyhugger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fluffyhugger/32/54396_2.png) [@fluffyhugger](https://forum.dynamobim.com/u/fluffyhugger)\
**Post date:** [March 19, 2019, 2:28pm UTC](https://forum.dynamobim.com/t/get-section-location/757/7 "2019-03-19T14:28:09Z")

</div>

I was able to get location of a view with a couple nodes from Rhythm package. But not sure if it always works…

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/8/08e8d04a40749fa901ebc12ce23a9cde872d83e6.png)
