Author Topic: Help with object instances  (Read 2552 times)

0 Members and 1 Guest are viewing this topic.

lightname

  • Guest
Help with object instances
« on: August 05, 2008, 12:23:35 PM »
Let's suppose I create 3 instances of object rectangle.

Dim R1,R2,Rerty as rectangle

Later in the code I want to know the names I have already used, that is I need a function that returns R1,R2,Rerty

Thank you again.

Bob Wahr

  • Guest
Re: Help with object instances
« Reply #1 on: August 05, 2008, 05:06:31 PM »
Is this ACAD VBA?  Autocad doesn't have a rectangle object.  Where is that being created?

Spike Wilbury

  • Guest
Re: Help with object instances
« Reply #2 on: August 05, 2008, 05:21:58 PM »
Is this ACAD VBA?  Autocad doesn't have a rectangle object.  Where is that being created?

Bob,

This was on the C++ forum... and moved here base on:

The use of the Dim statement

:)


Bob Wahr

  • Guest
Re: Help with object instances
« Reply #3 on: August 05, 2008, 06:56:09 PM »
Hi Luis, long time.  I'm not sure how much closer that gets us.

lightname, Dim R1, R2, Rerty as rectangle dims three things but not the way you seem to think that it does.  What you have actually done there is

Dim R1 as Variant
Dim R2 as Variant
Dim Rerty as Rectangle

Even if they were all dimmed as rectangles thogh, I don't know of any way to access it.

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Re: Help with object instances
« Reply #4 on: August 05, 2008, 07:02:10 PM »
if rectangle is a custom object, one way to do it would be to create a global or module level collection, then walk through the collection picking up the names. You could have each object add it's self to the collection in it's create method.