<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Array of Arrays in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354222#M97238</link>
    <description>Eugene,&lt;BR /&gt;
&lt;BR /&gt;
The statement&lt;BR /&gt;
    lstDetails = DetailsArray(0)(0)&lt;BR /&gt;
&lt;BR /&gt;
should be&lt;BR /&gt;
    lstdetails = DetailsArray(0) (X, X)&lt;BR /&gt;
&lt;BR /&gt;
X being the appropriate index you want.&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin&lt;BR /&gt;
Author of "AutoCAD 2000 VBA Programmers Reference"&lt;BR /&gt;
ISBN #1861002564 Order it at&lt;BR /&gt;
http://www.amazon.com/exec/obidos/ASIN/1861002564/o/qid%3D942504788/sr%3D8-1&lt;BR /&gt;
/002-7788324-2908264&lt;BR /&gt;
&lt;BR /&gt;
Checkout Sources - the only magazine dedicated to AutoCAD customization&lt;BR /&gt;
http://vbdesign.hypermart.net/sources/&lt;BR /&gt;
&lt;BR /&gt;
Eugene N. Kilmer &lt;KILMER&gt; wrote in message&lt;BR /&gt;
news:858l5q$mt616@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Group,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I've created a one-dimensional array of two-dimensional arrays.  I can see&lt;BR /&gt;
&amp;gt; the 2D arrays within the outer array, but I can't seem to dig out the&lt;BR /&gt;
second&lt;BR /&gt;
&amp;gt; dimension information.  The 2D array looks like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; DetailArray(0,0) = "Object name:"&lt;BR /&gt;
&amp;gt; DetailArray(0,1) = strObjName&lt;BR /&gt;
&amp;gt; DetailArray(1,0) = "Object ID:"&lt;BR /&gt;
&amp;gt; DetailArray(1,1) = intObjID&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Then I assign this 2D array to the first element of a one-dimensional&lt;BR /&gt;
array&lt;BR /&gt;
&amp;gt; like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; DetailsArray(0) = DetailArray&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; While watching the two arrays, I can see the information in the 2D array.&lt;BR /&gt;
I&lt;BR /&gt;
&amp;gt; can also see it in the one-dimensional array.  It looks like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; DetailsArray(0)(0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Under that, I see the 2D array, but I cannot dig out the second dimension&lt;BR /&gt;
&amp;gt; for display.  I assign the array to a list box with this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; lstDetails = DetailsArray(0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; but I only get the hard-coded strings, not the information contained in&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; variables.  I tried:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; lstDetails = DetailsArray(0)(0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; because that is what the watch window shows, but that produces an out of&lt;BR /&gt;
&amp;gt; subscript range error.  Does anyone know how to get the second dimension&lt;BR /&gt;
out&lt;BR /&gt;
&amp;gt; of the embedded array?  Thanks.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Eugene N. Kilmer&lt;BR /&gt;
&amp;gt; Owner/Mag Drafting&lt;BR /&gt;
&amp;gt;&lt;/KILMER&gt;</description>
    <pubDate>Sun, 09 Jan 2000 18:47:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2000-01-09T18:47:26Z</dc:date>
    <item>
      <title>Array of Arrays</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354221#M97237</link>
      <description>Group,&lt;BR /&gt;
&lt;BR /&gt;
I've created a one-dimensional array of two-dimensional arrays.  I can see&lt;BR /&gt;
the 2D arrays within the outer array, but I can't seem to dig out the second&lt;BR /&gt;
dimension information.  The 2D array looks like this:&lt;BR /&gt;
&lt;BR /&gt;
DetailArray(0,0) = "Object name:"&lt;BR /&gt;
DetailArray(0,1) = strObjName&lt;BR /&gt;
DetailArray(1,0) = "Object ID:"&lt;BR /&gt;
DetailArray(1,1) = intObjID&lt;BR /&gt;
&lt;BR /&gt;
Then I assign this 2D array to the first element of a one-dimensional array&lt;BR /&gt;
like this:&lt;BR /&gt;
&lt;BR /&gt;
DetailsArray(0) = DetailArray&lt;BR /&gt;
&lt;BR /&gt;
While watching the two arrays, I can see the information in the 2D array.  I&lt;BR /&gt;
can also see it in the one-dimensional array.  It looks like this:&lt;BR /&gt;
&lt;BR /&gt;
DetailsArray(0)(0)&lt;BR /&gt;
&lt;BR /&gt;
Under that, I see the 2D array, but I cannot dig out the second dimension&lt;BR /&gt;
for display.  I assign the array to a list box with this:&lt;BR /&gt;
&lt;BR /&gt;
lstDetails = DetailsArray(0)&lt;BR /&gt;
&lt;BR /&gt;
but I only get the hard-coded strings, not the information contained in the&lt;BR /&gt;
variables.  I tried:&lt;BR /&gt;
&lt;BR /&gt;
lstDetails = DetailsArray(0)(0)&lt;BR /&gt;
&lt;BR /&gt;
because that is what the watch window shows, but that produces an out of&lt;BR /&gt;
subscript range error.  Does anyone know how to get the second dimension out&lt;BR /&gt;
of the embedded array?  Thanks.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Eugene N. Kilmer&lt;BR /&gt;
Owner/Mag Drafting</description>
      <pubDate>Sun, 09 Jan 2000 00:38:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354221#M97237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-09T00:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Array of Arrays</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354222#M97238</link>
      <description>Eugene,&lt;BR /&gt;
&lt;BR /&gt;
The statement&lt;BR /&gt;
    lstDetails = DetailsArray(0)(0)&lt;BR /&gt;
&lt;BR /&gt;
should be&lt;BR /&gt;
    lstdetails = DetailsArray(0) (X, X)&lt;BR /&gt;
&lt;BR /&gt;
X being the appropriate index you want.&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin&lt;BR /&gt;
Author of "AutoCAD 2000 VBA Programmers Reference"&lt;BR /&gt;
ISBN #1861002564 Order it at&lt;BR /&gt;
http://www.amazon.com/exec/obidos/ASIN/1861002564/o/qid%3D942504788/sr%3D8-1&lt;BR /&gt;
/002-7788324-2908264&lt;BR /&gt;
&lt;BR /&gt;
Checkout Sources - the only magazine dedicated to AutoCAD customization&lt;BR /&gt;
http://vbdesign.hypermart.net/sources/&lt;BR /&gt;
&lt;BR /&gt;
Eugene N. Kilmer &lt;KILMER&gt; wrote in message&lt;BR /&gt;
news:858l5q$mt616@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Group,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I've created a one-dimensional array of two-dimensional arrays.  I can see&lt;BR /&gt;
&amp;gt; the 2D arrays within the outer array, but I can't seem to dig out the&lt;BR /&gt;
second&lt;BR /&gt;
&amp;gt; dimension information.  The 2D array looks like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; DetailArray(0,0) = "Object name:"&lt;BR /&gt;
&amp;gt; DetailArray(0,1) = strObjName&lt;BR /&gt;
&amp;gt; DetailArray(1,0) = "Object ID:"&lt;BR /&gt;
&amp;gt; DetailArray(1,1) = intObjID&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Then I assign this 2D array to the first element of a one-dimensional&lt;BR /&gt;
array&lt;BR /&gt;
&amp;gt; like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; DetailsArray(0) = DetailArray&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; While watching the two arrays, I can see the information in the 2D array.&lt;BR /&gt;
I&lt;BR /&gt;
&amp;gt; can also see it in the one-dimensional array.  It looks like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; DetailsArray(0)(0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Under that, I see the 2D array, but I cannot dig out the second dimension&lt;BR /&gt;
&amp;gt; for display.  I assign the array to a list box with this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; lstDetails = DetailsArray(0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; but I only get the hard-coded strings, not the information contained in&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; variables.  I tried:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; lstDetails = DetailsArray(0)(0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; because that is what the watch window shows, but that produces an out of&lt;BR /&gt;
&amp;gt; subscript range error.  Does anyone know how to get the second dimension&lt;BR /&gt;
out&lt;BR /&gt;
&amp;gt; of the embedded array?  Thanks.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Eugene N. Kilmer&lt;BR /&gt;
&amp;gt; Owner/Mag Drafting&lt;BR /&gt;
&amp;gt;&lt;/KILMER&gt;</description>
      <pubDate>Sun, 09 Jan 2000 18:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354222#M97238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-09T18:47:26Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354223#M97239</link>
      <description>Mr. Sutphin,&lt;BR /&gt;
&lt;BR /&gt;
That will get me the one element of the 2D array, but what I wanted to do&lt;BR /&gt;
was load a list box with the whole array.  If I were trying to do that with&lt;BR /&gt;
DetailArray, I would do it like this:&lt;BR /&gt;
&lt;BR /&gt;
lstDetails.list = DetailArray&lt;BR /&gt;
&lt;BR /&gt;
correct?  If DetailArray is a 2D array that is the first element of the&lt;BR /&gt;
one-dimensional array DetailsArray, I can't dump its entire contents into a&lt;BR /&gt;
list box?  Do I have to pull out each element separately and perhaps make&lt;BR /&gt;
yet another array I can load into the list box?&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Eugene N. Kilmer&lt;BR /&gt;
Owner/Mag Drafting</description>
      <pubDate>Sun, 09 Jan 2000 21:18:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354223#M97239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-09T21:18:47Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354224#M97240</link>
      <description>It appears you are attempting to place object names and their corresponding&lt;BR /&gt;
ObjectIDs into a listbox. If so, skip the one-dimensional array part. If so,&lt;BR /&gt;
here's a snippet to help you out. First, make sure you som objects to&lt;BR /&gt;
select. Then, add a listbox to a new UserForm  and add this code:&lt;BR /&gt;
&lt;BR /&gt;
Private Sub UserForm_Click()&lt;BR /&gt;
&lt;BR /&gt;
    Dim ss As AcadSelectionSet, i As Long&lt;BR /&gt;
    Dim tmp(), x As Long&lt;BR /&gt;
&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
    Set ss = ThisDrawing.SelectionSets("ss")&lt;BR /&gt;
    If err Then Set ss = ThisDrwing.SelectionSets.Add("ss")&lt;BR /&gt;
    ss.Clear&lt;BR /&gt;
    Me.Hide&lt;BR /&gt;
    ss.SelectOnScreen&lt;BR /&gt;
    x = ss.Count - 1&lt;BR /&gt;
&lt;BR /&gt;
    ReDim tmp(0 To x, 0 To x)&lt;BR /&gt;
    For i = 0 To ss.Count - 1&lt;BR /&gt;
        tmp(i, 0) = ss.Item(i).ObjectName&lt;BR /&gt;
        tmp(i, 1) = ss.Item(i).ObjectID&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
    ListBox1.List = tmp&lt;BR /&gt;
    Me.Show&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Sun, 09 Jan 2000 23:22:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354224#M97240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-09T23:22:25Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354225#M97241</link>
      <description>Boy, talk about typos! "Make sure you have some objects to select" is what I&lt;BR /&gt;
meant to say. Also, I forgot to mention you need to set the ColumnCount&lt;BR /&gt;
property to 2 on your listbox. If you don't want one or the other column to&lt;BR /&gt;
show, set its width to zero, For example, to hide the ObjectIDs, set&lt;BR /&gt;
ColumnWidths to ;0.&lt;BR /&gt;
&lt;BR /&gt;
The trick to filling a VBA listbox with an array is to set the ColumnCount&lt;BR /&gt;
property equal to the number of dimensions in your array.</description>
      <pubDate>Sun, 09 Jan 2000 23:31:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354225#M97241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-09T23:31:48Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354226#M97242</link>
      <description>Frank,&lt;BR /&gt;
&lt;BR /&gt;
Yes, I do have a two column list box and I can get the information I want&lt;BR /&gt;
from my 2D array without the one-dimensional array, but what I'm trying to&lt;BR /&gt;
do is have the information available for several objects in a drawing ready&lt;BR /&gt;
for display sequentially.  For example, let's say there are a circle, a&lt;BR /&gt;
line, and a piece of text in a drawing.  I wanted a 2D array of information&lt;BR /&gt;
for each of them ready beforehand, and each 2D array included in another&lt;BR /&gt;
one-dimensional array.  I thought I could set up "Next" and "Previous"&lt;BR /&gt;
buttons to show the information about each object as either of those buttons&lt;BR /&gt;
was pressed.  Initially, the 2D array would dump information about the&lt;BR /&gt;
circle into the list box and, when the "Next" button gets clicked, the 2D&lt;BR /&gt;
information about the line would load up, and so on.&lt;BR /&gt;
&lt;BR /&gt;
I was trying to get the one-dimensional array to control what 2D array gets&lt;BR /&gt;
loaded.  The first element of the flat array would be the 2D array about the&lt;BR /&gt;
circle, the next element, the 2D array about the line, etc.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Eugene N. Kilmer&lt;BR /&gt;
Owner/Mag Drafting</description>
      <pubDate>Mon, 10 Jan 2000 00:14:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354226#M97242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-10T00:14:00Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354227#M97243</link>
      <description>Use the 2D array you already have. Use your previous and next buttons to&lt;BR /&gt;
change the value of a form level variable. The form level variable&lt;BR /&gt;
corrsponds to the index of your 2D array's first dimension. At this point,&lt;BR /&gt;
it's easy enough to just manually assign the contents of the current index&lt;BR /&gt;
to your listbox manually.</description>
      <pubDate>Mon, 10 Jan 2000 01:26:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354227#M97243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-10T01:26:21Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354228#M97244</link>
      <description>Attached is a simple UserForm demonstrating what I was saying. Let me know&lt;BR /&gt;
if it's what you're looking for.&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:85bccl$rqk5@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Use the 2D array you already have. Use your previous and next buttons to&lt;BR /&gt;
&amp;gt; change the value of a form level variable. The form level variable&lt;BR /&gt;
&amp;gt; corrsponds to the index of your 2D array's first dimension. At this point,&lt;BR /&gt;
&amp;gt; it's easy enough to just manually assign the contents of the current index&lt;BR /&gt;
&amp;gt; to your listbox manually.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/FRANKO&gt;</description>
      <pubDate>Mon, 10 Jan 2000 02:02:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354228#M97244</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-10T02:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Array of Arrays</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354229#M97245</link>
      <description>This is to the VB programers:&lt;BR /&gt;
I have this user-defined public Type:&lt;BR /&gt;
&lt;BR /&gt;
Public Type MyCircle&lt;BR /&gt;
  X as Single&lt;BR /&gt;
  Y as Single&lt;BR /&gt;
  Dia as Long&lt;BR /&gt;
End Type&lt;BR /&gt;
&lt;BR /&gt;
now I declare public array of this type&lt;BR /&gt;
Public Circles() As MyCircle&lt;BR /&gt;
&lt;BR /&gt;
in the next step I need to create an array: "GroupCircles ",&lt;BR /&gt;
which is an array of arrays "Circles" of type "MyCircle"...&lt;BR /&gt;
What is the correct declaration for this purpose?</description>
      <pubDate>Thu, 20 Jul 2000 07:53:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354229#M97245</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-07-20T07:53:22Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354230#M97246</link>
      <description>If I' following you correctly, your second array should be of type Variant.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Attitudes are contagious. Is yours worth catching?&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
"Rafi" &lt;SBAMETAL&gt; wrote in message&lt;BR /&gt;
news:eebfae8.7@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; This is to the VB programers:&lt;BR /&gt;
&amp;gt; I have this user-defined public Type:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Public Type MyCircle&lt;BR /&gt;
&amp;gt;   X as Single&lt;BR /&gt;
&amp;gt;   Y as Single&lt;BR /&gt;
&amp;gt;   Dia as Long&lt;BR /&gt;
&amp;gt; End Type&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; now I declare public array of this type&lt;BR /&gt;
&amp;gt; Public Circles() As MyCircle&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; in the next step I need to create an array: "GroupCircles ",&lt;BR /&gt;
&amp;gt; which is an array of arrays "Circles" of type "MyCircle"...&lt;BR /&gt;
&amp;gt; What is the correct declaration for this purpose?&lt;BR /&gt;
&amp;gt;&lt;/SBAMETAL&gt;</description>
      <pubDate>Thu, 20 Jul 2000 14:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-of-arrays/m-p/354230#M97246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-07-20T14:39:44Z</dc:date>
    </item>
  </channel>
</rss>

