I have a need to be able to insert a family instance, then Mirror it about it's own X axis, Y axis, or both.
I found Autodesk.Revit.Document.Mirror with five overloads, and chose this one:
Autodesk.Revit.Document.Mirror(Autodesk.Revit.ElementSet, Autodesk.Revit.Geometry.Line) As Boolean
because it is the only one that uses a Line as the definition of the mirror base.
Notice the function only returns a boolean indicating success or failure.
first of all, I'm getting pretty wierd behavior where when I run a test of my code using a real example, I end up with one family instance in the correct position, at the wrong orientation, but when I set up a special test focusing on the problem, each time I mirror I end up creating a new instance, which I have no reference to. What I need is to have a reference to the newly created mirror, and delete the original, but I can't figure how to do that. I thought maybe the new instance would be added to the ElementSet passed to the method but it does not.
I have attached the function. Note that prior to calling this function I have already verified that the familyname passed to it is loaded in the project.
Anybody have any suggestions?
Edited by: chiefbraincloud on Oct 8, 2009 2:28 PM
OK, I figured out the wierd behavior, but I still have the same problem of needing to have a reference to the new mirrored object so I can manipulate it further.
Dave O.