Prevent a Mirror operation on a custom Entity

By Balaji Ramamoorthy

To stop a custom entity from being mirrored, inside the subTransformBy() method, simply check to see if the determinant of the matrix passed to it is negative – if so, then do nothing and return Acad::eOk.

Here is a sample code snippet :

Acad::ErrorStatus MyCustomLine::subTransformBy
                                    (const AcGeMatrix3d& xform)
{
    assertWriteEnabled( Adesk::kFalse );
 
    // Prevent mirror of our custom line 
    if(xform.det() < 0)
        return Acad::eOk;
 
    // Provide default implementation for other transformations
    return AcDbLine::subTransformBy(xform);
}

Comments

3 responses to “Prevent a Mirror operation on a custom Entity”

  1. Thanks for sharing, and my wife and I are thinking about getting custom mirrors for our bathrooms in our home. And we’re thinking about getting them made from http://www.careflections.com we just still deciding whether or not we want to go.

  2. I have been looking into getting a custom mirror for my house and I was just wondering if the site I found is the best for what I am looking for. They look really promising and really know what they are talking about. http://www.careflections.com

  3. As in many homes, I have a plain big mirror in my master suite. I am wondering if you were able to add a custom frame to it for me? I want a big chunky frame with detail, if at possible. I think it adds a lot of character to the bathroom.
    Alena | http://www.careflections.com

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading