Hi everyone,
I try to copy attachments from one element to another Face-based. Most obstacles I overcame. I have a problem with the host property of the attachmentpart. I place the new instance on an face of ​​the host element is determined by the NewFamilyInstance () call the Reference on the basic component set automatically. However, it will not link to, how expect the Familyinstance the base component registered, but the symbol Type.I have tried all possible ways and it seems to me that the Back-Reference of the face fails to actual element.
If the attachment with PromptForFamilyInstancePlacement(), or copy/Past placed in UI, the references are correctly calculated and set to the Familyinstance of the Host.
If I the new instace the NewFamilyInstance() - the Reference give a call area on the base member with the Reference is correctly entered in the host property, but new Instancen be placed on the reference plane. When I try to move the elements to the correct position. I always get an error message "can`t move Element".


Code examples (I reduced the code to essential):
Face-Based:
Code:
Reference r = commandData.Application.ActiveUIDocument.Selection.PickObject(
Autodesk.Revit.UI.Selection.ObjectType.Face, "Bitte Fläche auswählen."); 

Face NewFace = doc.GetElement(r.ElementId).GetGeometryObjectFromReference(r) as Face; 

using (SubTransaction Subtrans = new SubTransaction(doc))
{
   Subtrans.Start();
     fam = doc.Create.NewFamilyInstance(NewFace, NewKoordinates, new XYZ(NewKoordinates.X, NewKoordinates.Y, NewKoordinates.Z + 1), Sym);
   Subtrans.Commit();
}
//Commit seems OK, but in the Host-Property it refereneed to the FamilySymbol, not to the FamilyInstance of the Host.
Host-Based:
Code:
 Element Target = doc.GetElement(commandData.Application.ActiveUIDocument.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element, "Bitte das Ziel-Element auswählen."));

Reference r = new Reference(Target); 

using (SubTransaction Subtrans = new SubTransaction(doc))
{
   Subtrans.Start();
    fam = doc.Create.NewFamilyInstance(r, NewKoordinates, new XYZ(NewKoordinates.X, NewKoordinates.Y, NewKoordinates.Z + 1), Sym);
   Subtrans.Commit();
}
//Commit seems OK, the Host-Property referenced right to the FamilyInstance with is the Host. But it ignors the given Position, place the NewInstance on the on the ReferencePlane from Hostelement. Try to move the New Instance after it creation, give an error. "Can`t move Element".
Placed in UI:
NewFamilyInstance facebased copy to Element wrong Reference-faceplacementuiplacedreference1.jpg

Via API:
NewFamilyInstance facebased copy to Element wrong Reference-faceplacementnewreference1.jpg

About Help I would be very happy
Regards
Dev