Thanks, Paul but...
I can't seem to get this thing straight. I *know* it's something simple,
but I just can't put my finger on it.
Here's the code I've got so far...
[code]
Option Explicit
Public Sub CreateXrecord()
Dim oXrec As AcadXRecord
Dim oDict As AcadDictionary
Dim oLayer As AcadLayer
Dim vType() As Integer
Dim vData() As Variant
Dim i As Integer
ReDim Preserve vData(0 To i)
ReDim Preserve vType(0 To i)
Set oDict = ThisDrawing.Dictionaries.Add("MY_LAYERS")
For Each oLayer In ThisDrawing.Layers
vType(i) = 1
vData(i) = oLayer.Name
Set oXrec = oDict.AddXRecord("MY_LAYER_STATES")
oXrec.SetXRecordData vType, vData
i = i + 1
ReDim Preserve vData(0 To i)
ReDim Preserve vType(0 To i)
Next
Set oXrec = Nothing
End Sub
Public Sub ReadXrecord()
Dim oXrec As AcadXRecord
Dim oDict As AcadDictionary
Dim vType() As Integer
Dim vData() As Variant
Dim i As Integer
Set oDict = ThisDrawing.Dictionaries("MY_LAYERS")
' This is where I'm lost.
' What's the syntax to read the contents of the dictionaries xrecords?
For i = LBound(oXrec) To UBound(oXrec)
Next
Set oXrec = Nothing
Set oDict = Nothing
End Sub
[/code]
It's shaping up to be a good world series!
Now if I could only find a place that sells the "Yankee Hater" hats I'll be
all set.
--
I support two teams: the Red Sox and whoever beats the Yankees.
"Paul Richardson"
wrote in message
news:4167d027$1_3@newsprd01...
| Matt, You could also add LBounds...
|
| For I = LBound(XrecordData) _
| to UBound(XrecordData)
|
| Paul
|
| "Paul Richardson" wrote in message
| news:4167c7b2_2@newsprd01...
| > Matt, Find the upper bounds of the record....
| >
| > For I = 0 to UBound(XrecordData)
| >
| > Nice game last night...Go Bronson...Bring
| > on the Yanks....
| >
| > Paul
| >
| >
| > "Matt W" wrote in message
| > news:4166f123$1_1@newsprd01...
| > > I'm new to this whole XRECORD concept so please bear with me...
| > >
| > > I've got a dictionary (MY_LAYERS) set up that Within that dictionary
is
| an
| > > XRECORD (MY_LAYER_STATES) which contains the current layers within the
| > > drawing.
| > > I'm able to write everything to the dictionary and xrecord no problem!
| > >
| > > The problem I'm running into is this: How can I now read the contents
of
| > the
| > > xrecord?? The number of entries within the xrecord will vary from one
| > > drawing to another.
| > >
| > > Thanks in advance!
| > >
| > >
| > > --
| > > I support two teams: the Red Sox and whoever beats the Yankees.
| > >
| > >
| > >
| >
| >
|
|