Selectionset using filters

Selectionset using filters

Anonymous
Not applicable
485 Views
2 Replies
Message 1 of 3

Selectionset using filters

Anonymous
Not applicable
how to make selection set using filters as we will be doing in auotcad VBA similary i need to make selection set using vb.net Message was edited by: Ramya
0 Likes
486 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
This one looks for blocks on a layer.
ed.select...
where ed = autodesk.autocad.editor

Public Sub TestSelectionSet()
Using trans As Transaction = db.TransactionManager.StartTransaction
Try
Dim psr As PromptSelectionResult
Dim ss As SelectionSet
Dim oids As ObjectIdCollection
Dim ent As Entity
Dim oid As ObjectId
Dim br As BlockReference
Dim filter(1) As TypedValue
filter(1) = New TypedValue(DxfCode.Start, "INSERT")
filter(0) = New TypedValue(DxfCode.LayerName, "FLOOR 1")
Dim sf As New SelectionFilter(filter)
psr = ed.SelectCrossingWindow(New Point3d(0, 0, 0), New Point3d(4, 4, 0), sf)
ss = psr.Value
If ss.Count > 0 Then
oids = New ObjectIdCollection(ss.GetObjectIds)
For Each oid In oids
ent = oid.GetObject(OpenMode.ForRead)
If TypeOf ent Is BlockReference Then
br = CType(ent, BlockReference)
'Debug.Print(br.Name)
End If
Next
End If
Catch ex As System.Exception
MsgBox(ex.ToString)
Finally
trans.Dispose()
End Try
End Using
End Sub
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanku very much
0 Likes