Get Boundary Elements in RVT 16

Get Boundary Elements in RVT 16

rvtquestions
Advocate Advocate
646 Views
1 Reply
Message 1 of 2

Get Boundary Elements in RVT 16

rvtquestions
Advocate
Advocate

I am trying to test out and learn more about the room/space and boundary classes for the Revit API. I tried debugging an example I found from Jeremy:

 

Under the section: 

GetBoundarySegmentElement External Command Implementation

 

http://thebuildingcoder.typepad.com/blog/2013/10/determining-a-room-boundary-segment-generating-elem...

 

However debugging gives me the error:

 

---

List<Room> rooms = new List<Room>(
sel.Elements.Cast<Room>() );

 

Error CS1061 'Selection' does not contain a definition for 'Elements' and no extension method 'Elements' accepting a first argument of type 'Selection' could be found (are you missing a using directive or an assembly reference?) GetBoundarySegmentElement 

 

---

foreach( BoundarySegment seg in loop )
{
Element e = seg.Element;

 

Severity Code Description Project File Line Suppression State
Warning CS0618 'BoundarySegment.Element' is obsolete: 'This property is deprecated in Revit 2016. Use ElementId instead.' GetBoundarySegmentElement 

 

--- 

 

Any help would be greatly appreciated to help get this running for RVT 16. Thank you!

 

 

0 Likes
647 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

You need to migrate the code to the new API.

 

That is trivial.

 

First time migration, including some reading of 'What's New' information: 20 minutes, maybe.

 

Next time: less than five minutes.

 

 Have you searched for an answer at all?

 

I must have answered this dozens of time already.

 

Surely some trace must remain somewhere?

 

http://thebuildingcoder.typepad.com/blog/migration

 

http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html

 

http://thebuildingcoder.typepad.com/blog/2015/06/cnc-direct-export-wall-parts-to-dxf-and-sat.html#20...

 

Have fun!

 

Cheers,

 

Jeremy



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

0 Likes