/
SavePlugInInfo.rvb
79 lines (66 loc) · 2.86 KB
/
SavePlugInInfo.rvb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' SavePlugInInfo.rvb -- April 2008
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' SavePlugInInfo
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SavePlugInInfo
Dim objShell, objNetwork, objFSO, objFolder, objStream
Dim arrPlugIns, arrSorted, strPlugIn, strDesktop, strFile, strName, strMsg
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strName = "RhinoPlugInInfo.txt"
strDesktop = objShell.SpecialFolders("Desktop")
strFile = strDeskTop & "\" & strName
'On Error Resume Next
Set objStream = objFSO.CreateTextFile(strFile, True)
If Err Then
MsgBox Err.Description
Exit Sub
End If
objStream.WriteLine "**************************************************"
objStream.WriteLine "Rhino Plug-in Info"
objStream.WriteLine ""
objStream.WriteLine "Computer Name = " & objNetwork.ComputerName
objStream.WriteLine "Date and Time = " & CStr(Now)
objStream.WriteLine "Rhino Build Date = " & CStr(Rhino.BuildDate)
objStream.WriteLine "Rhino SDK Version = " & CStr(Rhino.SdkVersion)
objStream.WriteLine "**************************************************"
objStream.WriteLine ""
objStream.WriteLine "**************************************************"
objStream.WriteLine "Loaded Plug-ins"
objStream.WriteLine "**************************************************"
objStream.WriteLine ""
arrPlugIns = Rhino.PlugIns(0, 1)
If IsArray(arrPlugIns) Then
arrSorted = Rhino.SortStrings(arrPlugIns)
For Each strPlugIn In arrSorted
objStream.WriteLine strPlugIn
Next
End If
objStream.WriteLine ""
objStream.WriteLine "**************************************************"
objStream.WriteLine "Unloaded Plug-ins"
objStream.WriteLine "**************************************************"
objStream.WriteLine ""
arrPlugIns = Rhino.PlugIns(0, 2)
If IsArray(arrPlugIns) Then
arrSorted = Rhino.SortStrings(arrPlugIns)
For Each strPlugIn In arrSorted
objStream.WriteLine strPlugIn
Next
End If
objStream.Close
strMsg = "A file named " & Chr(34) & strName & Chr(34) & VbCrLf
strMsg = strMsg & "has been saved to your desktop." & VbCrLf & VbCrLf
strMsg = strMsg & "If you are experiencing problems with Rhino," & VbCrLf
strMsg = strMsg & "email this file to " & Chr(34) & "tech@mcneel.com" & Chr(34) & VbCrLf
strMsg = strMsg & "along with a detailed description" & VbCrLf
strMsg = strMsg & "of your problem."
MsgBox strMsg, 64, "Rhinoceros"
End Sub