Centre line of window

Centre line of window

Anonymous
Not applicable
959 Views
7 Replies
Message 1 of 8

Centre line of window

Anonymous
Not applicable

Hello everyone,

 

I want to extract the coordinates of  endpoints (centre line) of a window. Could I use the similar way, just like using LocationCurve to get the location of wall ? Or Is there better method to achieve this goal ?

Thanks

 

Kind regards

Hao

0 Likes
960 Views
7 Replies
Replies (7)
Message 2 of 8

jeremytammik
Autodesk
Autodesk

This sounds like a prime use of the new API access to FamilyInstance references:

 

http://thebuildingcoder.typepad.com/blog/2017/04/whats-new-in-the-revit-2018-api.html#3.19

 

Cheers,

 

Jeremy



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

0 Likes
Message 3 of 8

Anonymous
Not applicable

Thanks Jeremy,

 

This should be a good method. But, the new API access to FamilyInstance reference is not available now.  Is these any other method to achieve my goal? 

What I want to achieve is that I want to extract four endpoints of the center plane of the window. The center plane of the window should be a inlay (same space position) of the center plane of the wall. The following figure shows this issue. Thanks.

question.PNG

 

Kind regards 

Hao

0 Likes
Message 4 of 8

jeremytammik
Autodesk
Autodesk

Sure.

 

Here is a suggestion:

 

  • Determine the bounding box B of the window.
  • Determine the plane P defined by the location line of the wall and the Z axis.
  • Project B onto P.

 

That gives you the four desired points.

 

Cheers.

 

Jeremy



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

Message 5 of 8

Kevin.Bell
Advisor
Advisor

Could you not use the BoundingBox of the object to work out the extremities of the window and then from that the centre points?

0 Likes
Message 6 of 8

Anonymous
Not applicable

Hi Kevin,

 

Not yet now. I'm trying to use this method. Have you worked it out?

 

Kind regards 

Hao

0 Likes
Message 7 of 8

Kevin.Bell
Advisor
Advisor

I don't follow your question...

 

... but if your asking how I would go about it, then look at the Element Class, this has a property called 'BoundingBox'. The issue you might have with that it that the Bounding Box is always aligned to the axes of the model coordinate system (according to the API help file), and so you'd need to work out the rotation of the window if its not orthogonal to the axes.

 

Perhaps an easier way would be to work out the coordinates you need based on what you know of the window.

 

You could easily extract the windows insertion point coordinates probably using the Location property of the Element Class, then, your just need to extract the Width from the width parameter and (assuming the insertion point is in the middle of the window) you could calculate the coordinates...

 

Just a thought.

 

 

Message 8 of 8

Revitalizer
Advisor
Advisor

Hi,

 

there may be non-rectangular windows, so I think you not only want to get four corner points if there is a round or L-shaped window.

What about ExporterIFCUtils.GetInstanceCutoutFromWall() ?

 

You can project those curves to whatever plane you define.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine