Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,all:
I want to mirror an entity with XData,
But after mirroring, the new entity has no XData.
The following is the method,
Could anyone tell me whether there is an easy way to reallize it?
public static ObjectId Mirror(this ObjectId id, Point3d mirrorPt1, Point3d mirrorPt2, bool eraseSourceObject)
{
Line3d miLine = new Line3d(mirrorPt1, mirrorPt2);
Matrix3d mt = Matrix3d.Mirroring(miLine);
ObjectId mirrorId = id;
Entity ent = (Entity)id.GetObject(OpenMode.ForWrite);
if (eraseSourceObject == true)
ent.TransformBy(mt);
else
{
Entity entCopy = ent.GetTransformedCopy(mt);
mirrorId = id.Database.AddToCurrentSpace(entCopy);
}
return mirrorId;
}
Solved! Go to Solution.