Perhaps a bit crude, but what about trying the following code
Dim ItemExists as boolean
ItemExist = false
for each item in thisdo***ent.modelspace
if item.handle = h then
ItemExists = true
exit for
end if
next item
'now if there is a item with the handle ItemExist will be set to True....
Good luck.
"ErPotenza" <no.mail@[EMAIL PROTECTED]
> schreef in bericht
news:wMeAh.27072$wO2.381@[EMAIL PROTECTED]
> I'm doing some tests with VBA and I'm having a problem:
>
> Public Sub Test()
> Dim p1 As Point
> Set p1 = Library.CreatePoint(0, 0, 0)
> Dim p2 As Point
> Set p2 = Library.CreatePoint(50, 50, 0)
> Dim l As Line
> Set l = ThisDo***ent.ModelSpace.AddLine(p1, p2)
>
> Dim h As String
> h = l.Handle
>
> l.Delete
>
> Dim o As Object
> Set o = ThisDo***ent.HandleToObject(h)
> End Sub
>
> On the last line of the Sub,
>
> Set o = ThisDo***ent.HandleToObject(h)
>
> h is the handle of a deleted line, but HandleToObject returns the line
> without a problem. In Autocad a similar situation would raise an
> exeption. Is it possible to know when, given a handle, the respective
> entity exists or not?
>
> Thanks
>
>


|