Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Mirroring Elements Issues

jacsmithstrongtie
Contributor

Mirroring Elements Issues

jacsmithstrongtie
Contributor
Contributor

Hello everyone,

 

I am looking for some help with a using the ElementTransformUtils.MirrorElements(doc, MirElems, MirPlane, False).

 

The transaction does not commit and the Exception reads 

jacsmithstrongtie_0-1711651696695.png

I have wrapped this in ElementTransformUtils.CanMirrorElements() and the result is true.  So, my question is why would this be happening?  Is there a way to see where the bad element(s) may be?

 

Any help would be greatly appreciated!

Thank you

0 Likes
Reply
202 Views
1 Reply
Reply (1)

Mohamed_Arshad
Advisor
Advisor

Hi @jacsmithstrongtie 

 

       This exception rises when you try to mirror pinned elements, Place a checkpoint Before mirroring to check the element are Pinned or Not.

 

Exception Reference Image:

 

MirrorElements Method (Document, ICollection(ElementId), Plane, Boolean) 

 

 

Mohamed_Arshad_0-1711689628052.png

 

Reference Code

///Check the element is Pinned to Not
                if (e.Pinned)
                {
                    e.Pinned = false; ///Un-Pin the element if it is pinned
                }

 

Hope this will Helps 🙂

 

Thanks & Regards,
Mohamed Arshad K
0 Likes