Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Room Outline Operation

5 REPLIES 5
Reply
Message 1 of 6
eluo
1755 Views, 5 Replies

Room Outline Operation

Hi,

Is there a way to get an outline of room and offset this outline to other side of the wall?

here are some thoughts:

          - get outline from the room is simple.

          - get each boundary wall thickness : get BoundarySegment, then get wall id from BoundarySegment, 

now the tricky part is that i can not simply offset the outline, because the boundary wall thickness could be varies.

Screenshot_1.png

There is also a further question,

if the first question is resolved, how to apply this to 2 rooms and get a big outline just cover these 2 rooms?

Screenshot_2.png

 

Thanks,
Eric Luo
5 REPLIES 5
Message 2 of 6
jeremytammik
in reply to: eluo

First question: use the Revit API CreateViaOffset method:

 

https://apidocs.co/apps/revit/2019/6cffc624-d197-0f3b-b68c-26b9c9a0adf8.htm

 

This was discussed just today in another thread:

 

https://forums.autodesk.com/t5/revit-api-forum/offset-xyz-points/m-p/8665334

 

In order to combine multiple rooms, you can use a Boolean operation on their boundary polygons:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.2

 

Here is a recent discussion in intersections, equally valid for unions:

 

https://thebuildingcoder.typepad.com/blog/2018/12/fire-rating-zone-intersection.html#4

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6
eluo
in reply to: jeremytammik

Thanks for your reply, Jeremy.

 

CreateViaOffset method offset same distance for each line of the boundary, see screenshot below, but i want to create the red outline from the green outline (room boundary).

 

Untitled.jpg

 

  • since i can the room boundary and each boundary wall thickness
  • i can offset each point of the room boundary
  • create new outline from the new points

Screenshot_1.png

 

 

Regarding to Boolean operation.

I've been using VS to write quite a few Zero-Touch Dynamo nodes, and read all your blogs about Boolean operation using Clipper.

when I used Clipper.cs, my Zero-Touch node can't be loaded into Dynamo library, so I think that's because Dynamo doesn't support SomeGenericClass<T>?

https://github.com/DynamoDS/Dynamo/wiki/Zero-Touch-Plugin-Development#can-i-use-generics-

 

Is there a way to use Clipper.cs in Dynamo Zero-Touch node? Hope this is not out of the topic.

 

Thanks.

Eric Luo

 

Thanks,
Eric Luo
Message 4 of 6
jeremytammik
in reply to: eluo

Since the clipper library is open source, you can compile it all into one single C# library, or create a C++ DLL, or package it in any way you wish: 

 

http://angusj.com/delphi/clipper.php

 

I am sure that some form or other can be loaded into and accessed from Dynamo.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 6
jeremytammik
in reply to: eluo

Regarding your calculations for handling the varying wall thicknesses and offsetting the room boundary points:

  

If you need the outline to always follow the exterior wall boundary, the easiest way to go might be to create separate 2D polygons in the XY plane for the room itself and all its bounding walls separately, then create a Boolean union of them all.

  

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 6
stephen_harrison
in reply to: eluo

I have been struggling with the same issue and was wondering if you managed to solve the problem of offsetting the room boundary to the outer face of the wall, including curved walls?

if so any pointers or solution you could share would be much appreciated. 

For clarity I am not utilising Dynamo, just C# and the api.

 

Regards

Stephen

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report