# Create floorplan from rooms with specific number

**URL:** <https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134>\
**Category:** Revit\
**Tags:** python\
**Created:** [April 23, 2019, 2:47pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134 "2019-04-23T14:47:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 23, 2019, 2:47pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/1 "2019-04-23T14:47:39Z")

</div>

Hey all,

I think you must be busy with this kind of request, but I try.  
I’m a bit noobie with Dynamo but I want to make a script that will help us to create crop of each view from appartment name.  
I’m looking for a solution since this morning, tried to read a maximum of information about this… and I didn’t make what I want.  
For the moment :

- I can select room by name
- I can obtain geometry
- I can intersect with plan and obtain a kinf of surface
- I can create a crop view if there is only one room.

Problem is whene there is more than one room : I don’t know how I can have out boundary of it.  
In my head, I hope I can offset each polygon, merge all and have only one area.  
But how ?

Is there any one who can help me ?

In my example, I select rooms with “02” as name.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/b/db0d2c303086c5edd582de586cc4e09c5bc2d9ca.png)  
Thanks a lot!

Mickaël  
(And sorry for my poor english level)

---

<div class="post-metadata">

**Author:** ![maciek.glowka](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/maciek.glowka/32/70695_2.png) [@maciek.glowka](https://forum.dynamobim.com/u/maciek.glowka)\
**Post date:** [April 23, 2019, 3:01pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/2 "2019-04-23T15:01:11Z")

</div>

you could try to get all the boundary vertices and apply some kind of alpha shape algorithm…see below:

> [@Concave Hull (Alpha Shape) from list of points with Python?](https://forum.dynamobim.com/t/concave-hull-alpha-shape-from-list-of-points-with-python/34058/19):
>
> Sorry, I don’t have anything better. The only alternative is to use a while loop / goal seek type of approach, where you try to minimize the alpha size, while still producing a single continuous external loop.

---

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 23, 2019, 3:11pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/3 "2019-04-23T15:11:57Z")

</div>

Thanks @maciek.glowka  
But, if I really understand your link, it is the case where we only have points.  
With Dynamo, I hope it is possible to create an offset of each room perimeter and make a kind of boolean and get the out hull…  
This alpha version seems to be so complex and not accurate for what I want to do…

But thanks.

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [April 23, 2019, 3:43pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/4 "2019-04-23T15:43:59Z")

</div>

This works for me…

I expect there is a more efficient way and it’s possible that you won’t always get room boundaries to join perfectly… Obviously if your rooms are not bounded by the same walls it will fail…

I’m sure there are much better ways 🙂

[set view crop by rooms.dyn](https://forum.dynamobim.com/uploads/short-url/cjQX5clgKiiVgISsv25lIkToIco.dyn) (29.5 KB)

 ![set%20view%20crop%20by%20rooms](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/7/77653f6da4e74d406098100a30017140baf35a6c.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/a/9a8e0ca73388455b77850b67ca3906229e11a9b5.png)

Hope that’s useful,

Mark

---

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 23, 2019, 3:57pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/5 "2019-04-23T15:57:15Z")

</div>

@Mark.Ackerley You are wonderfull. I didn’t really understand the conversion from room to surface and perimeter but it solves my problem. I’ve put this in my script and it’s works fine.

Thanks a lot.

EDIT : I’ve tried on a real project and an error is occur with polycurve 😕

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [April 23, 2019, 4:02pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/6 "2019-04-23T16:02:59Z")

</div>

No worries 🙂

So it’s not that complex…

Joining 2 surfaces gives 1 surface with a Perimeter to use as my crop box curves…

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/7/67b113d136a2441cfa6da08527b86767760d2311.png)

Can you show us the error? Does it mention Wires Intersecting?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 23, 2019, 9:51pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/7 "2019-04-23T21:51:16Z")

</div>

Why not use a bounding box instead of a poly? Doing so will also aid in performance of the Revit model.

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [April 24, 2019, 1:15am UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/8 "2019-04-24T01:15:41Z")

</div>

Does this help?

> **[create view by room with dynamo](http://archi-lab.net/create-view-by-room-with-dynamo/)**
>
> This is another one of the long overdue posts, or if someone prefers, posts that I have been sitting on for a while and just didn’t have time to release them. This particular workflow was ins…

---

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 24, 2019, 6:43am UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/9 "2019-04-24T06:43:50Z")

</div>

Hey all,

I’ve find problem : when I’ve got a hole in the surface, crop can’t work.  
So I really need to have the outline of all.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/f/3f4d7b9cceb44f48a0e20121ecf33a7466fc042e.png)

---

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 24, 2019, 6:45am UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/10 "2019-04-24T06:45:53Z")

</div>

Thanks @SeanP, but I’ve ever seen it. It doesn’t make what I need.  
Or I didn’t use it successfully.

---

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 24, 2019, 6:48am UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/11 "2019-04-24T06:48:42Z")

</div>

@jacob.small perhaps it could be solution to have only the outline of my rooms

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [April 24, 2019, 7:17am UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/12 "2019-04-24T07:17:04Z")

</div>

@jacob.small I guess it depends if the OP needs the crop oriented to the room? Perhaps not 🙂

If it has to be rotated to the view, this fixes that problem, but there are always things that fail that you wouldn’t expect!

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/e/eedbb110392d928df7ebbb5957f23ff8948766ba.png) [set view crop by rooms-1.dyn](https://forum.dynamobim.com/uploads/short-url/iYEsrNgQlFswMoZM4GnUP98IXDk.dyn) (39.4 KB)

---

<div class="post-metadata">

**Author:** ![ATII](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@ATII](https://forum.dynamobim.com/u/ATII)\
**Post date:** [April 24, 2019, 12:37pm UTC](https://forum.dynamobim.com/t/create-floorplan-from-rooms-with-specific-number/35134/13 "2019-04-24T12:37:29Z")

</div>

I’ve give a try to another method.  
First, I’ve looked for a solution to merge each surface together to have only one surface… didn’t find how to achieve this.  
Second, I’ve tested different length and find a node which help me : group curve.  
Made a test to find the max. length and use it to draw my crop… It seems to works but not with all offset ^^
