Mirror fails "Can't Copy to Clipboard because of relationships between Elements"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Trying to mirror a beam via the API. Same mirror works with the UI. With the API it fails with this error for a roof in the model that has a constraint with the beam.
Selection cannot be copied.
Can't Copy to Clipboard because of relationships between Elements
This makes no sense. I am not trying to copy the roof.
Document macro included in the attached RVT
public void mirrorBeam()
{
Document doc = this.Document;
UIDocument uidoc = new UIDocument(doc);
Element rafter1 = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element));
PlanarFace pf = rafter1.GetGeometryObjectFromReference(uidoc.Selection.PickObject(ObjectType.Face)) as PlanarFace;
using (Transaction t = new Transaction(doc, "Mirror"))
{
t.Start();
ElementTransformUtils.MirrorElement(doc, rafter1.Id, Plane.CreateByNormalAndOrigin(pf.FaceNormal, pf.Origin));
t.Commit();
}
}