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.