- 积分
- 25209
- 明经币
- 个
- 注册时间
- 2003-6-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2020-9-30 08:57:07
|
显示全部楼层
/// <summary>
/// 移动并即时显示多个实体
/// Version : 2008.12.12
/// </summary>
/// <param name="objClt">实体集合</param>
/// <param name="basePoint">初始点</param>
/// <param name="showOnly">只是显示,true : 只是显示图形并不把图形画出来;false : 最后会把图形画出来</param>
/// <param name="note"></param>
/// <returns>确认式的结束返回true,放弃或出错返回false</returns>
public bool MoveJig(DBObjectCollection objClt, Point3d basePoint, bool showOnly, string note)
{
try
{
//_Note = note;
ents = new Entity[objClt.Count];
for (int i = 0; i < objClt.Count; i++)
{
ents[i] = (Entity)objClt[i].Clone();
}
_PrePosition = basePoint;
PromptResult pRes = ac.ed.Drag(this);
if (pRes.Status == PromptStatus.OK)
{
Vector3d displacementVector = _CurPosition - basePoint;
for (int i = 0; i < objClt.Count; i++)
{
Entity ent = (Entity)objClt[i];
ent.TransformBy(Matrix3d.Displacement(displacementVector));
}
if (showOnly)
return true;
else
{
an.DrawEntity(objClt, aEntclls.Null, false);
return true;
}
}
else
return false;
}
catch (System.Exception ex)
{
ae.WriteMessage(ex);
}
finally
{
for (int i = 0; i < ents.Length; i++)
{
ents[i].Dispose();
}
}
return false;
} |
|