TheSwamp

Code Red => VB(A) => Topic started by: Tuoni on January 30, 2007, 06:34:46 AM

Title: EntityArray(0) showing as out of range, even though it's there...
Post by: Tuoni on January 30, 2007, 06:34:46 AM
Anyone got any ideas why I am getting this error?

As you can see, EntityArray(0) is populated, the other alt-tag style dialog I have had is EntityArray(0) = Nothing, though as you can see, it doesn't!

I have cleared the selectionset in question... I'm stumped :(  Any ideas?
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: Arizona on January 30, 2007, 06:45:42 AM
When you say you cleared the selection set, did you delete it?
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: Tuoni on January 30, 2007, 07:59:22 AM
The code I used is "ThisDrawing.SelectionSets(objectType).Clear" (where objectType is equivalent to "AcDbBlockReference").

It only appears to cause an error when having this block as its entry in (0), so my assumption (for what it's worth) is that it is an error caused by the block...
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: Tuoni on January 30, 2007, 08:07:33 AM
Well I never... Arizona, I added the lines

Code: [Select]
ThisDrawing.SelectionSets(objectType).Delete
ThisDrawing.SelectionSets.Add objectType

to my function... and it worked!  Strange that in the months of testing, this has never been a problem...

Well, thanks for the kick up the arse about something I guess I should have done all along!
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: Arizona on January 30, 2007, 10:49:10 AM
Autocad doesn't like when you try to add a selection set that has the same name as an existing selection set.
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: Tuoni on January 30, 2007, 10:51:14 AM
I know, what I was doing was clearing it then setting it as the current selectionset.  I dunno.  Well it works now, anyways.
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: David Hall on January 30, 2007, 12:18:48 PM
Well I never... Arizona,

She's a coding  :angel:

Helped me out of a few brain-hangers as well.
Title: Re: EntityArray(0) showing as out of range, even though it's there...
Post by: Maverick® on January 30, 2007, 12:41:10 PM
She's a coding  :angel:

Coding anyway.   :-D

   :angel:               :evil:         
           (      )
     ____)    (____
   (                      )
    l   l              l   l
    l   l              l   l