Pick a face in document, pick same face in familydocument - how?

Pick a face in document, pick same face in familydocument - how?

Anonymous
Not applicable
676 Views
2 Replies
Message 1 of 3

Pick a face in document, pick same face in familydocument - how?

Anonymous
Not applicable

Hi everyone!

I have searched the Internet for information but didn't found what I needed. That's what bring me here.
I'm trying to create an addin where I need to pick a face in a family through the project.

First question: Is it possible?

I've used Revit Lookup to see if there is any match between the face in the project and the face in the family but I can't find any. It is only the area that matches but that's not good enough for me. 

Next question: Can you guys help me?

0 Likes
677 Views
2 Replies
Replies (2)
Message 2 of 3

recepagah12
Advocate
Advocate

First, yes it is possible to select a face and get it geometry and information from it via Revit API.

But, I think you are new in the Revit API. So, I suggest you start learning the basics.

 

Here are some blogs for learning Revit 

Autodesk Revit Developer's Guide

Building Coder

AEC Developer Blog

 

And I strongly suggest you look through the Revit SDK samples.

 

Finally, I want to show you how to select a face and it is really easy.

Reference reference = uidoc.Selection.PickObject(ObjectType.Face);
Element e = doc.GetElement(reference);

GeometryObject geomObj = e.GetGeometryObjectFromReference(reference);

Face face = geomObj as Face;
double area = face.Area;

 

I hope this helps,

Have a good day,

Recep.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi @recepagah12,

 

Thanks for your reply.

I made it work before I saw your post. Thanks anyway. 🙂

 

 

0 Likes