- 积分
- 25214
- 明经币
- 个
- 注册时间
- 2003-6-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2015-6-11 13:23:17
|
显示全部楼层
本帖最后由 sieben 于 2015-6-11 13:25 编辑
private void btn_SelectOAS_Click(object sender, EventArgs e)
{
DocumentLock dLock = aApp.DocumentManager.MdiActiveDocument.LockDocument();
try
{
//this.Hide();这个你可以不用
TypedValue[] arrValue1 = { new TypedValue(1001, "PAOAS") };//过滤器要用你自己的哦
SelectionFilter selFilter1 = new SelectionFilter(arrValue1);
PromptSelectionOptions psOpt4 = new PromptSelectionOptions();
psOpt4.MessageForAdding = "\n选择OAS命令生成的图形";
psOpt4.SingleOnly = true;//这个要注意看是否必要
PromptSelectionResult psRes4 = sc.ed.GetSelection(psOpt4, selFilter1);
//你应该用这个 public PromptSelectionResult SelectFence(Point3dCollection fence, SelectionFilter filter);
//或者用这个public PromptSelectionResult SelectCrossingPolygon(Point3dCollection polygon, SelectionFilter filter);
//又或者public PromptSelectionResult SelectCrossingWindow(Point3d pt1, Point3d pt2);
if (psRes4.Status == PromptStatus.OK)
{
using (Transaction ctrans = sc.db.TransactionManager.StartTransaction())
{
foreach (ObjectId tId in psRes4.Value.GetObjectIds())
{
Entity ent1 = (Entity)ctrans.GetObject(tId, OpenMode.ForWrite);
//这里,你想干嘛就干嘛,你想干掉他?还是想给他化个妆?都可以
}
ctrans.Commit();
}
}
}
catch (System.Exception ex)
{
se.WriteMessage(ex);
}
finally
{
// this.Show();这个你可以不用
dLock.Dispose();//这个千万不要忘记了
}
}
PS:这只是示意,不是实例 |
|