Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computer Aided Design - CAD > IntelliCAD software > Re: VBA, Handle...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 317 of 366
Post > Topic >>

Re: VBA, HandleToObject and handles of deleted entities.

by "Huib" <huibvanderpas@[EMAIL PROTECTED] > Feb 17, 2007 at 04:57 PM

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
>
>
 




 2 Posts in Topic:
VBA, HandleToObject and handles of deleted entities.
ErPotenza <no.mail@[EM  2007-02-13 09:36:44 
Re: VBA, HandleToObject and handles of deleted entities.
"Huib" <huib  2007-02-17 16:57:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Nov 20 1:55:15 CST 2008.