Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all
iam using this code for copy any entity in autocad
public static Entity Copy(Entity entity, Point3d BasePoint, Point3d SecondPoint)
{
Matrix3d UCS = Application.DocumentManager.MdiActiveDocument.Editor.CurrentUserCoordinateSystem;
Entity ent;
BasePoint = BasePoint.TransformBy(UCS.Inverse());
SecondPoint = SecondPoint.TransformBy(UCS.Inverse());
using (Transaction acTrans = Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)acTrans.GetObject(Application.DocumentManager.MdiActiveDocument.Database.CurrentSpaceId, OpenMode.ForWrite);
ent = (Entity)entity.Clone();
btr.AppendEntity(ent);
acTrans.AddNewlyCreatedDBObject(ent, true);
Vector3d disp = BasePoint.TransformBy(UCS).GetVectorTo(SecondPoint.TransformBy(UCS));
ent.TransformBy(Matrix3d.Displacement(disp));
acTrans.Commit();
}
return ent;
}but i have a problem with copy anonymous block . because this code copy the block name with starting *U.
i need any function copy the effective block with anonymous block properties that i selected to copy.
or how can i insert block but has the anonymous block properties (attributes and parametric dimensions ....)
Solved! Go to Solution.