/// <summary>
/// 获取插入点
/// </summary>
/// <param name="objectId"></param>
/// <returns></returns>
private static Point3d GetPosintion(ObjectId objectId)
{
Point3d point3D = new Point3d();
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
using (Transaction trans = doc.TransactionManager.StartOpenCloseTransaction())
{
//Entity ent = trans.GetObject(objectId, OpenMode.ForRead) as Entity;
//point3D = ent.Position;
BlockReference blkRef = trans.GetObject(objectId, OpenMode.ForRead) as BlockReference;
if (blkRef != null)
{
point3D = blkRef.Position;
}
trans.Commit();
}
return point3D;
}
CAD.NET 获取插入点
最新推荐文章于 2021-09-30 16:14:22 发布