# Create floorplan from rooms with specific number

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.

Thanks a lot!

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

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

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.

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 (29.5 KB)

Hope that’s useful,

Mark

@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

No worries

So it’s not that complex…

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

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

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

Does this help?

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.

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

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

@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!

set view crop by rooms-1.dyn (39.4 KB)

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 ^^