Message 1 of 3
ListBox Help

Not applicable
03-24-2004
11:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm having troubles creating a list box. What i'm doing is listing all entities with xdata from the app "AssoxText" and adding them to a list. I would like the listbox to have two columns. Both columns will have info taken from the xdata that I've filtered for. I've used this code to get all the objects with "AssocText" xdata.
Dim ssetObj As AcadSelectionSet
Dim mode As Integer
Dim gpCode(1) As Integer
Dim dataValue(1) As Variant
Dim groupCode As Variant
Dim dataCode As Variant
Dim xdataOut As Variant
Dim xtypeOut As Variant
Dim appName As String
Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")
mode = acSelectionSetAll
gpCode(0) = 0
dataValue(0) = "Mtext"
gpCode(1) = 1001
appName = "AssocText"
dataValue(1) = appName
groupCode = gpCode
dataCode = dataValue
ssetObj.Select mode, , , groupCode, dataCode
Then I iterate through all the objects in the selection set and add them into the list box with this code.
For Each Entry In ssetObj
Entry.GetXData appName, xtypeOut, xdataOut
XdataList1.AddItem xdataOut(1)
Next ent
This code works fine. But i'd also like to add xdataOut(2) to the list in the second column. I'm having trouble finding any examples or info in the on-line docs to point me the right way. At the moment I just created a second listbox and did it this way:
For Each Entry In ssetObj
Entry.GetXData appName, xtypeOut, xdataOut
XdataList1.AddItem xdataOut(1)
XdataList2.AddItem xdataOut(2)
Next ent
Can someone give me some pointers or info on how to add this info into the second column. Thanks for your help.
Cheers,
Matthew Corbin
I'm having troubles creating a list box. What i'm doing is listing all entities with xdata from the app "AssoxText" and adding them to a list. I would like the listbox to have two columns. Both columns will have info taken from the xdata that I've filtered for. I've used this code to get all the objects with "AssocText" xdata.
Dim ssetObj As AcadSelectionSet
Dim mode As Integer
Dim gpCode(1) As Integer
Dim dataValue(1) As Variant
Dim groupCode As Variant
Dim dataCode As Variant
Dim xdataOut As Variant
Dim xtypeOut As Variant
Dim appName As String
Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")
mode = acSelectionSetAll
gpCode(0) = 0
dataValue(0) = "Mtext"
gpCode(1) = 1001
appName = "AssocText"
dataValue(1) = appName
groupCode = gpCode
dataCode = dataValue
ssetObj.Select mode, , , groupCode, dataCode
Then I iterate through all the objects in the selection set and add them into the list box with this code.
For Each Entry In ssetObj
Entry.GetXData appName, xtypeOut, xdataOut
XdataList1.AddItem xdataOut(1)
Next ent
This code works fine. But i'd also like to add xdataOut(2) to the list in the second column. I'm having trouble finding any examples or info in the on-line docs to point me the right way. At the moment I just created a second listbox and did it this way:
For Each Entry In ssetObj
Entry.GetXData appName, xtypeOut, xdataOut
XdataList1.AddItem xdataOut(1)
XdataList2.AddItem xdataOut(2)
Next ent
Can someone give me some pointers or info on how to add this info into the second column. Thanks for your help.
Cheers,
Matthew Corbin