Message 1 of 3
ListBox - MultiSelect
Not applicable
06-26-2006
01:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This should work, right?
'SetLispVar provided by Tony Tanzillo
Public Sub SetLispVar(Symbol As String, Value)
Dim vlapp As Object
Dim vlFuncs As Object
Dim vlSet As Object
Dim vSym
Set vlapp = CreateObject("Vl.Application.16")
Set vlFuncs = vlapp.ActiveDocument.Functions
Set vSym = vlFuncs.Item("read").funcall(Symbol)
Set vlSet = vlFuncs.Item("set")
Select Case VarType(Value)
Case vbByte, vbInteger, vbLong
Dim lVal As Long
lVal = Value
vlSet.funcall vSym, lVal
Case vbString
Dim strVal As String
strVal = Value
vlSet.funcall vSym, strVal
Case vbDouble
Dim dblVal As String
dblVal = Value
vlSet.funcall vSym, dblVal
Case vbEmpty
vlSet.funcall vSym, vlFuncs.Item("read").funcall("nil")
Case Else
If IsArray(Value) Then
Dim List As Variant
List = Value
vlSet.funcall vSym, List
Else
vlSet.funcall vSym, Value
End If
End Select
End Sub
'populate a multiselect ListBox with Layer names
Private Sub UserForm_Initialize()
For Each Entry In ThisDrawing.Layers
MultiListBox.AddItem Entry.Name
Next
End Sub
'pass the selected layer names to the Lisp Variable "jb%MultiSelect"
Private Sub OkButton_Click()
Dim cnt As Integer
cnt = MultiListBox.ListCount - 1
SetLispVar "jb%MultiSelect", MultiListBox.Selected(cnt)
End Sub
(vlax-safearray->list(vlax-variant-value jb%MultiSelect)) should return a
list of the selected layer names.
Any thoughts???
thanks,
jb
'SetLispVar provided by Tony Tanzillo
Public Sub SetLispVar(Symbol As String, Value)
Dim vlapp As Object
Dim vlFuncs As Object
Dim vlSet As Object
Dim vSym
Set vlapp = CreateObject("Vl.Application.16")
Set vlFuncs = vlapp.ActiveDocument.Functions
Set vSym = vlFuncs.Item("read").funcall(Symbol)
Set vlSet = vlFuncs.Item("set")
Select Case VarType(Value)
Case vbByte, vbInteger, vbLong
Dim lVal As Long
lVal = Value
vlSet.funcall vSym, lVal
Case vbString
Dim strVal As String
strVal = Value
vlSet.funcall vSym, strVal
Case vbDouble
Dim dblVal As String
dblVal = Value
vlSet.funcall vSym, dblVal
Case vbEmpty
vlSet.funcall vSym, vlFuncs.Item("read").funcall("nil")
Case Else
If IsArray(Value) Then
Dim List As Variant
List = Value
vlSet.funcall vSym, List
Else
vlSet.funcall vSym, Value
End If
End Select
End Sub
'populate a multiselect ListBox with Layer names
Private Sub UserForm_Initialize()
For Each Entry In ThisDrawing.Layers
MultiListBox.AddItem Entry.Name
Next
End Sub
'pass the selected layer names to the Lisp Variable "jb%MultiSelect"
Private Sub OkButton_Click()
Dim cnt As Integer
cnt = MultiListBox.ListCount - 1
SetLispVar "jb%MultiSelect", MultiListBox.Selected(cnt)
End Sub
(vlax-safearray->list(vlax-variant-value jb%MultiSelect)) should return a
list of the selected layer names.
Any thoughts???
thanks,
jb