TheTick
Mechanical
- Mar 5, 2003
- 10,194
I can't seem to get this to work. I've tried many different ways of defining rGelt, but no go. I keep getting a type mismatch error when I run.
pasted from API help:
Syntax (OLE Automation)
retval = EnumDocuments2.Next ( celt, rgelt, &pceltFetched )
Input:
(long) celt
Number of documents desired for the enumerated list
Output:
(LPMODELDOC2*) rgelt
Pointer to an array of size celt to hold the documents
Output:
(long) pceltFetched
Pointer to the number of documents returned from the list; this value can be less than celt if you ask for more documents than exist, or it can be NULL if no more documents exist.
end of pasted text
Private Sub cmdEnum_Click()
Dim f As Long
Dim eList As SldWorks.EnumDocuments2
Dim eItem As SldWorks.ModelDoc2
Dim Celt As Long
Dim rGelt(0 To 0) As SldWorks.ModelDoc2
Dim pCeltFetched As Long
Dim DocList() As String
Dim DocCounter As Long
Celt = 1
DocCounter = -1
Set eList = swApp.EnumDocuments2
eList.Reset
Do
retVal = eList.Next(Celt, rGelt, pCeltFetched)
If pCeltFetched < 1 Then Exit Do
DocCounter = DocCounter + 1
ReDim Preserve DocList(0 To DocCounter)
DocList(DocCounter) = rGelt(LBound(rGelt)).GetPathName
Loop
Files = DocList
lboDocs.Clear
lboDocs.List = Files
End Sub
All this machinery making modern music can still be open-hearted.
pasted from API help:
Syntax (OLE Automation)
retval = EnumDocuments2.Next ( celt, rgelt, &pceltFetched )
Input:
(long) celt
Number of documents desired for the enumerated list
Output:
(LPMODELDOC2*) rgelt
Pointer to an array of size celt to hold the documents
Output:
(long) pceltFetched
Pointer to the number of documents returned from the list; this value can be less than celt if you ask for more documents than exist, or it can be NULL if no more documents exist.
end of pasted text
Private Sub cmdEnum_Click()
Dim f As Long
Dim eList As SldWorks.EnumDocuments2
Dim eItem As SldWorks.ModelDoc2
Dim Celt As Long
Dim rGelt(0 To 0) As SldWorks.ModelDoc2
Dim pCeltFetched As Long
Dim DocList() As String
Dim DocCounter As Long
Celt = 1
DocCounter = -1
Set eList = swApp.EnumDocuments2
eList.Reset
Do
retVal = eList.Next(Celt, rGelt, pCeltFetched)
If pCeltFetched < 1 Then Exit Do
DocCounter = DocCounter + 1
ReDim Preserve DocList(0 To DocCounter)
DocList(DocCounter) = rGelt(LBound(rGelt)).GetPathName
Loop
Files = DocList
lboDocs.Clear
lboDocs.List = Files
End Sub
All this machinery making modern music can still be open-hearted.