Article | 41023988 |
Type | HowTo |
Product | Engine |
Version | 5.1.1.1037 |
Date Added | 5/30/2005 |
Submitted by | matjaz jakljevic |
Keywords |
The general idea is to use "select" method (crossing "C") with a small equality.
Dim equality As Double
Dim pt As Variant
Dim selset As vdSelection
'''''Ignore the entities in frozen layers
''''vdraw.Actions.IgnoreLockLayers = True
equality = vdraw.PickSize * vdraw.ScreenRender.PixelSize / 2#
vdraw.Prompt "Select entities at Point :"
pt = vdraw.Utility.GetPoint
vdraw.Prompt ""
If IsEmpty(pt) Then
MsgBox "Command canceled"
Exit Sub
End If
Set selset = vdraw.ActiveDocument.Selections.FindName("myselection")
If selset Is Nothing Then
Set selset = vdraw.ActiveDocument.Selections.Add("myselection")
Else
selset.RemoveAll
End If
selset.Select "C", Array(pt(0) - equality, pt(1) - equality), Array(pt(0) + equality, pt(1) + equality)
MsgBox "Selected : " & selset.Count & " entities."