Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get element on which face belongs

1 REPLY 1
Reply
Message 1 of 2
james.levieux
122 Views, 1 Reply

Get element on which face belongs

Hi All,
I'm trying to build a program that replaces the Paint command because I want to add a warning in the event that the painted element has certain properties. This needs to work both in the model and the family editor.

 

First, I'm using PickObject using a Face filter to mimick the Paint command which works fine, but sure would like to also exclude objects that are not paintable (both in the model and the family editor)

 

Reference faceRef = uidoc.Selection.PickObject(ObjectType.Face, new FaceFilter(uidoc.Document)

 

After that, the part I can't figure out, is how to acquire the element on which the face belongs. Again, this needs to work both in the family editor (where the element may be an extrusion or a sweep, etc.), or in the main model (where the element may be a wall or a floor, etc.)

 

Any advice would be much appreciated.

Regards,

James

1 REPLY 1
Message 2 of 2

You can use Reference.ElementId:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report