Get boundary of floors with SlabShapeEditor enabled

Get boundary of floors with SlabShapeEditor enabled

daniel
Enthusiast Enthusiast
5,561 Views
3 Replies
Message 1 of 4

Get boundary of floors with SlabShapeEditor enabled

daniel
Enthusiast
Enthusiast

HI, 

I am trying to get the boundary of a complex floor. 

Currently I am able to get all det edges, both bounary and interio edges, by using topface and use alle edges produced from this.. (typical 3 pr face) 

 

Iterating trough edges with this code 

var creases = floor.SlabShapeEditor.SlabShapeCreases;
var boundaryCuvrves = new List<Curve>();
var listOfExceptions = new List<Exception>();
foreach (SlabShapeCrease cease in ceases)
{
if (crease.CreaseType == SlabShapeCreaseType.Boundary)
{
try
{
boundaryCuvrves.Add(crease.Curve);
}
catch (Exception e )
{
listOfExceptions.Add(e); 
}
}

}

theese curves are boundarys, and all of them, But only 2 points.. this means that arcs, splines etc.
is returned as straight lines.. 

 

 

Anyone know a way to get the 3D edges of such floors ? 

 

 

 

 

0 Likes
Accepted solutions (1)
5,562 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Dear Daniel,

 

Thank you for your query.

 

I would expect that accessing the floor geometry using the standard get_Geometry method would return the full geometry including the correct 3D edges and their curves.

 

Here is a really old discussion by The Building Coder showing the principles:

 

http://thebuildingcoder.typepad.com/blog/2008/11/editing-a-floor-profile.html

 

CmdEditFloor is included in The Building Coder samples, so the updated vurrent version is available online from GitHub:

 

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/C...

 

I hope this helps.

 

Best regards,

 

Jeremy



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

0 Likes
Message 3 of 4

daniel
Enthusiast
Enthusiast

Using the geometry, will give all the lines in the floor. This is how i do it in the existing tool. 

 

The case of just getting the boundarys is a bit more tricky.. 

 

I will have a deeper look into it in a couple of weeks, se if I can map things a bit together.. 

 

Daniel 

0 Likes
Message 4 of 4

daniel
Enthusiast
Enthusiast
Accepted solution

I think I've found the solution now.

 

This will work on hostobjects. (floor, ceiling, wall and roof)

 

I get all the boundary lines from the HostObjectUtils.GetTop/Side/BottomFace()

 

After this I sort the curveloops on length. My assumptions is then that a opening is shorter than a outer boundary. 

There might be situations where this fails, but then the opening would have a area greater than 0.5 square meters, and those I don't need.

 

When I have all the curveloops, I Create solids from a host loop and one opening. then I use BooleanOperations to check if one solid is inside another, if true I map the curveloop as inside, else i put it in a "outside" list. then i do this requsive on the "outside" list.. 

 

This gives me all the holes in a wall, floor, roof or ceiling in a swift way.

 

Daniel