Both the 2014 and 2015 Revit API help files state that a family can be inserted on a face in a linked file. I want to use the NewFamilyInstance method with the following overload NewFamilyInstance(face, XYZ, direction, symbol)
Can anyone provide a working code sample showing how this can be achieved:
I can get everything working in the host model but have followed the help files (which are minimal or non-existent) attempting to use the same method on linked files.
To select a face in the host model I use:
PickObject(ObjectType.Face, "Select the Ceiling Grid on to Attach the object");
To select the face in the linked file I am using:
PickObject(ObjectType.LinkedElement, faceFilter, "Select a Face in a linked document");
The facefilter actually filters a ceiling grid but by inspecting the id's and data of the elements returned they match exactly what is returned if I open the link file and use the host select method.
I have found reference to the following method in the help files which should enable me to get a link that I can use to host a familiy to a face. The remarks in the help file state:
"The reference that is returned can be used to create a family instance on a face in an RVT link."
public Reference CreateLinkReference(
RevitLinkInstance revitLinkInstance
)
I have tried implementing this method in every conceivable way but cannot work out how it is used or exactly what parameters need passing to it. Also is this method applied to the host document or a reference to the link document (ie: doc.CreateLinkReference or linkdoc.CreateLinkReference or something else entirely, again I have tried every option I can conceive of.
I would be very grateful for an example showing how I can attach a face hosted family to a Revit Linked file (a ceiling grid in particular). The closest I came to resolving this resulted in a the object being linked directly to the host model not the ceiling that is returned from hte Pickpoint above.
Many Thanks
Paul M
Greetings
i was researching the same issue, did you reach anything from when you posted this in 2014 till now, and what do you mean by "The closest I came to resolving this resulted in a the object being linked directly to the host model "
thanks in advance