How to check if Boundary Segment is a room separator

How to check if Boundary Segment is a room separator

Anonymous
Not applicable
1,041 Views
2 Replies
Message 1 of 3

How to check if Boundary Segment is a room separator

Anonymous
Not applicable

I'm trying to create a script that creates a floor for a room but ignores room separators.

 

Here is what I have so far: 

var boundarySegments = room.GetBoundarySegments(opt);

if(boundarySegments.Count != 0)
    {
        var points = new List<XYZ>();

        foreach(var boundSeg in boundarySegments[0])
            {
                if(userInfo.IgnoreSeperators)
                    {
                        var element = doc.GetElement(boundSeg.ElementId);

                        if (!(element.Category.Id.IntegerValue == BuiltInCategory.OST_RoomSeparationLines))

 

However (element.Category.Id.IntegerValue == BuiltInCategory.OST_RoomSeparationLines) still lets the Room Separator through.

 

Any ideas on how I can catch an element if it is a room separator?

0 Likes
Accepted solutions (1)
1,042 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor
Accepted solution

Ordinarily I believe your boundary segments should either be Walls or ModelLines if they are the latter then they will be of category OST_RoomSeparationLines since no other category of ModelLine defines the boundary of a room?

 

You may be better off getting the ClosedShell of the Rooms and taking edges from bottom faces of resulting solid to use in your floor sketch.

 

Why does removing the room separation lines help you? If you have different finishes in two rooms separated by a separator line then you want a finishes slab for each not one covering both. Perhaps those finishes are the same but it is easy to make two things the same type rather than changing a sketch. Also in terms of a room data sheet the floor finishes element can be related to the room it is in (since it doesn't span two rooms). 

 

As a human doing it manually you would probably amalgamate the two slabs with same finishes when automating the process it is probably more convenient to not.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi,

Thank you for your answer!

 

Turns out I was being stupid and left some old code in the loop which was adding the room separator boundary segment curve to the rest of the CurveArray.

0 Likes