Faceless windows and doors :o

Playing with this:

for ele in RevitElements:
geo = ele.Geometry[opt]
geometry.append(geo)
for g in geo:
face = g.Faces
faces.extend(face)

I’ve discovered windows and doors don’t have faces…

I assumed that face would mean surface (dunno why I assumed that)…

How do I extract the faces :laughing: (surfaces) of windows/ doors?

Look at what you have in geo - it’s likely instance Geometry, which means you have to inform Revit what type of geometry you want to get, the base family type or the instance type.

OUT = geo, dir(geo) should help.

Yay…

But… then I get:

I’m really confused :frowning:

Your imports are incomplete again. Instead of only importing XYZ on line 9, import everything (*).

Think you’ll see that list of options expand when you do so.

Ah damn! Thanks :slight_smile:

That won’t make the Geometry instance have the attribute “GetBoundingBox” though.

Question was, how come it says it’s got that attribute in the first picture, but then when I try to get it, I’m told it hasn’t got that attribute.

i believe it is because in this case the class (InstanceGeometry) isn’t inheriting the method, but the subsequent classes (ie: Solid) are, so it’s there but not yet usable.

Could you give me some idea of how to make it usable?

Obvs I could just use Element.Geometry node… but was trying to extract stuff without converting to geometry

I’m at the airport, but I’ll give some guidance from what I can recall. All code samples are apt to fail though.

Take the GeometryInstance object and pull the actual geometry from it. This is the API call. GetInstanceGeometry Method (Transform)

From there you should have a list of geometries, I’m guessing solids and various curves based on your categories. The object returned might not be a list (check with OUT = variableName.__class__) , but it should be iterable, so you can use a list comprehension to filter down to just the solids (variableName = i for I in variableName if i.GetType() == Solid`).

Union the solids into one solid with a BooleanOperationsUtils method: ExecuteBooleanOperation Method

From the unioned solid you can start to pull faces with this property: Faces Property

1 Like

Thank you! Really appreciate yours (and everyone else’s) patience :smiley:

I got excited cos I found some stuff in the API… but then it only half worked :person_facepalming:

1 Like

Hi @Alien
out of my curiosity, what is the end goal ? (extract face’s windows / doors)

I’m experimenting with different ways to do the same thing.

So finding the building footprint in this case.

If I don’t have any corner windows it works fine with walls…
But if I have corner windows there are no faces I can extract so it messes up my method.

So I’m trying to find the faces, or edges or lines or vertices (not fussy) of windows and doors.

1 Like

I prefer one big exterior room in those cases.

  • Get the extents of a new 3D view and convert to a new bounding box.
  • Move the maximum point by a reasonable distance on the + X and + Y axis, then pull it onto the plane you want to get the footprint at.
  • Move the minimum point by a reasonable distance on the -X and -Y axis, then pull it onto the plane you want to get the footprint at.
  • Draw a rectangle aligned to the XY axis using the relocated min and max points.
  • Convert the rectangles to room separation lines. * Translate the min point by 1/2 of a reasonable distance on the + X and + Y axis, and create a room at this point.
  • Name the room ‘outdoors’ and give it a number as desired.
  • Get the boundary curve loops of the new room, and find the one with less area. That is your footprint. :slight_smile:
1 Like

It’s just dawned on me (I woke up and thought ‘oh’)… that I could probably automate all of that so I’m not relying on the user to do a thing… :astonished:

1 Like

Yep. The beauty of this is also that you can set up a schedule to subtract the area of the room names ‘exterior’ or whatnot from the area of the outer rectangle and it will be parametric as the design changes. Just need to let users know to not delete it and which schedule has the info on it.

2 Likes

I used the, place room separation lines + place external room before…

But manually (and everyone hated it)…

Why on earth didn’t I think to automate it.
I feel really, really stupid :rofl:

2 Likes

Hi @Alien

if it can help you, here is a trick to get the solid of an opening

3 Likes

If I create the rooms, it won’t read the lines right away, I have to run it twice.

Is there a way round this?

Guessing the transaction needs to be committed, but not sure.