Fatty,
Excuse me, but it is not what i want.
I want to program only
objSS.SelectOnScreen
-----------------------------
Here i want to know the 2 points clicked if user choose Windows or crossing by
clicking only a rectangle, not choose W ot C
----------------------------
I do not want
fstCorner = .Utility.GetPoint(, "Enter first corner of window")
sndCorner = .Utility.GetCorner(fstCorner, "Enter opposite corner of window")
Sorry
--
Bernard Flavignard
a écrit dans le message de news: 5148003@discussion.autodesk.com...
Okay, see this example but very quick and dirty...
[code]
Sub Example_SelectBy_Window()
' This example adds members to a selection set by window
Dim objnewss As AcadSelectionSet
Dim objSelColl As AcadSelectionSets
Dim fstCorner, sndCorner As Variant
With ThisDrawing
Set objSelColl = .SelectionSets
For Each objnewss In objSelColl
If objnewss.Name = "$TestSset$" Then
objSelColl.Item("$TestSset$").Delete
Exit For
End If
Next objnewss
Set objnewss = objSelColl.Add("$TestSset$")
fstCorner = .Utility.GetPoint(, "Enter first corner of window")
sndCorner = .Utility.GetCorner(fstCorner, "Enter opposite corner of window")
Dim mode As Integer
mode = acSelectionSetWindow
' another mode you can use:
'acSelectionSetCrossing
objnewss.Select mode, fstCorner, sndCorner
objnewss.Highlight True
'' pause for the user
.Utility.Prompt vbCr & objnewss.Count & " entities selected"
.Utility.GetString False, vbLf & "Enter to continue "
'' dehighlight the entities
objnewss.Highlight False
End With
MsgBox ("First corner : " & vbCrLf & _
"X: " & CStr(fstCorner(0)) & vbCr & _
"Y: " & CStr(fstCorner(1)) & vbCr & _
"Z: " & CStr(fstCorner(2)))
MsgBox ("Second corner : " & vbCrLf & _
"X: " & CStr(sndCorner(0)) & vbCr & _
"Y: " & CStr(sndCorner(1)) & vbCr & _
"Z: " & CStr(sndCorner(2)))
End Sub
Fatty
~'J'~
[/code]
Message was edited by: Fatty