本帖最后由 hnzgs 于 2011-3-14 11:05 编辑
回复 382327412 的帖子
用过滤器- '获取当前活动文档的Editor对象
- Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
- Dim db As Database = HostApplicationServices.WorkingDatabase
- '定义过滤条件
- Dim values() As TypedValue = {New TypedValue(DxfCode.Start, "INSERT")}
- '建立过滤器
- Dim sfilter As New SelectionFilter(values)
- '返回选择集的用户提示类.
- Dim resSel As PromptSelectionResult
- resSel = ed.SelectAll(sfilter)
- If resSel.Status <> PromptStatus.OK Then
- ' 得到选择集中所有对象的ObjectId集合.
- Dim ids As ObjectId() = resSel.Value.GetObjectIds()
- End If
|