为什么实体没有闪烁直线没有被被修改
string Hand = dg_data.Rows.Cells.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();
}
}
这样实体为什么没有没有闪烁,直线的两点也没有被修改
页:
[1]