Author Topic: EntityArray(0) showing as out of range, even though it's there...  (Read 1085 times)

0 Members and 1 Guest are viewing this topic.

Tuoni

  • Gator
  • Posts: 3031
  • A programmer in this life, once again!
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?

Arizona

  • Guest
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #1 on: January 30, 2007, 06:45:42 AM »
When you say you cleared the selection set, did you delete it?

Tuoni

  • Gator
  • Posts: 3031
  • A programmer in this life, once again!
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #2 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...

Tuoni

  • Gator
  • Posts: 3031
  • A programmer in this life, once again!
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #3 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!

Arizona

  • Guest
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #4 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.

Tuoni

  • Gator
  • Posts: 3031
  • A programmer in this life, once again!
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #5 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.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #6 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.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

Maverick®

  • Seagull
  • Posts: 14777
Re: EntityArray(0) showing as out of range, even though it's there...
« Reply #7 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