- 积分
- 381
- 明经币
- 个
- 注册时间
- 2013-9-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
string Hand = dg_data.Rows[e.RowIndex].Cells[1].Value.ToString();
using (DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument())
{
using (Transaction trans = extDatabase.TransactionManager.StartTransaction())
{
try
{
if (LastId != null)
{
Entity Ent = trans.GetObject(LastId, OpenMode.ForWrite) as Entity;
Ent.Unhighlight();
}
}
catch { }
long val = Convert.ToInt64(Hand, 16);
Handle hCG = new Handle(val);
// convert to objectid
ObjectId newId = extDatabase.GetObjectId(false, hCG, 0);
Entity ent = trans.GetObject(newId, OpenMode.ForWrite) as Entity;
if (ent.GetType().Name == "Line")
{
ent.Highlight();
ent.ColorIndex = 1;
Line line = ent as Line;
if (line != null)
{
line.StartPoint = new Point3d(35500.0+val, 25100.0, 0.0);
line.EndPoint = new Point3d(36500.0+val, 25100.0, 0.0);
}
}trans.Commit();
}
}
这样实体为什么没有没有闪烁,直线的两点也没有被修改
|
|