.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
About ed.SelectW indow select range
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I find the ed.SelectWindow is not always select the correct range. with drawing zoom out, the range is not within the two points specified, the range is larger than the actual range.that means the ed.SelectWindow can not be trusted.why and how can get rid of that?
thanks.
Re: About ed.SelectW indow select range
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You may want to zoom window before you run your sample
Public Sub ZoomWindow(db As Database, minpt As Point2d, maxpt As Point2d)
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.D ocumentManager.MdiActiveDocument
Dim view As ViewTableRecord = New ViewTableRecord()
view.CenterPoint = (minpt + (maxpt - minpt) / 2.0)
view.Height = (maxpt.Y - minpt.Y)
view.Width = (maxpt.X - minpt.X)
doc.Editor.SetCurrentView(view)
db.UpdateExt(True)
End Sub
<CommandMethod("ZOOMW")> _
Public Sub ZoomREctangle()
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.D ocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
ZoomWindow(db, New Point2d(2, 2), New Point2d(8, 8))
End Sub
~'J'~
C6309D9E0751D165D0934D0621DFF27919
Re: About ed.SelectW indow select range
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
thanks Hallex.but I already zoomed before ed.SelectWindow.
Re: About ed.SelectW indow select range
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
How did you zoom ?
Remind SendStringToExecute (or SendCommand) doesn't run synchronously and may happen after the selection.
Use a hard-coded zoom method as shown by Hallex.
Re: About ed.SelectW indow select range
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
thanks gile
Actually, I run command ZOOM E first,then run the command to execute ed.SelectWindow.
And the fact is, if the view is large enough the selection is correct,but when Zoom extent or zoom out to a very small size, the selection always contains some entities outside the range.
