Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66796

Placing a Family Instance on a face of an element

$
0
0

Hi All,

I am currently trying to write a very simple code to place a face-based void on the face of an element (in the family environment - no in a project), it seems pretty simple and straight forward but still have so much trouble doing that:

1. I am selecting the face of the element by:

face = PickObject(ObjectType.Face)

2. I am trying to place the family by using this method which requires "face" and not "reference" : 

familyInst = doc.FamilyCreate.NewFamilyInstance(face, location, direction, familysymbol)

it gives me this error: requires "face", got "reference"

3. So I checked the PickObject method and it seems that the returned object is a reference. Now I am trying to retrieve the "face" itself from the "reference" by:

id = face.ElementId
element = doc.GetElement(id)

4. When I run the program it gives me this error:

expected "face", got "form"

5. So now it seems that the doc.GetElement() gives me the solid object which contains that face! but I want the face itself!

Any help is much appreciated.


Viewing all articles
Browse latest Browse all 66796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>