Message 1 of 2
how to get correct ole2Frame.Location?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
// read file to Database
using Database db = new Database(false, true);
db.ReadDwgFile(fileName, FileShare.ReadWrite, true, null);
db.CloseInput(true);
using Transaction acTrans = db.TransactionManager.StartTransaction(); BlockTable acBlkTbl = acTrans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
//
BlockTableRecord acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForRead) as BlockTableRecord;
// 1.1 遍历模块空间块记录
foreach (ObjectId objId in acBlkTblRec)
{
Entity entity= acTrans.GetObject(objId, OpenMode.ForRead) as Entity;
if (entityis Ole2Frame ole2Frame)
{
Point3d pt = ole2Frame.Location; // Here pt={0,0,0}
}
}
how to get corrct Location?