ursan Posted September 9, 2017 Posted September 9, 2017 hi guys my app code in following. i want to find blockreference in between two points. when i zoom extent working correct. bu i change zoom in autocad result incorrect. i added screenshot. i use SelectCrossingWindow or SelectWindow finally same. Public Sub FindBlockInFrame(frame As Extents3d) Dim tvs As TypedValue() = New TypedValue() _ { New TypedValue(DxfCode.Start, "INSERT"), New TypedValue(DxfCode.BlockName, "myblock") } Dim filter As New SelectionFilter(tvs) Dim selection As PromptSelectionResult = ed.SelectCrossingWindow(frame.MinPoint, frame.MaxPoint, filter) 'Dim selection As PromptSelectionResult = ed.SelectWindow(frame.MinPoint, frame.MaxPoint, filter) If selection.Status <> PromptStatus.OK Then Return End If Using tr As Transaction = db.TransactionManager.StartTransaction() Dim list As New List(Of BlockReference) For Each id As ObjectId In selection.Value.GetObjectIds() Dim block As BlockReference = DirectCast(tr.GetObject(id, OpenMode.ForRead), BlockReference) list.Add(block) Next ed.WriteMessage(vbLf & "block count in frmae {0})", list.Count) tr.Commit() End Using End Sub zoom extent: zoom out: zoom out,zoom out,zoom out: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.