-
Notifications
You must be signed in to change notification settings - Fork 0
/
Class1.vb
386 lines (310 loc) · 17.4 KB
/
Class1.vb
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
Imports System
Imports System.Windows.Forms
Imports System.IO
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.Civil.ApplicationServices
Public Class Class1
<CommandMethod("ip")>
Public Sub ip()
Dim compName As String, compAddr As String
compName = Net.Dns.GetHostName
#Disable Warning BC40000 ' Type or member is obsolete
compAddr = Net.Dns.GetHostByName(compName).AddressList(0).ToString()
#Enable Warning BC40000 ' Type or member is obsolete
MsgBox("Computer name: " & compName & vbCrLf & "Computer Address: " & compAddr)
End Sub
<CommandMethod("NMDOTCaddStandards")>
Public Sub NMDOTCaddStandards()
Dim fn As String
fn = "S:\support\docs\NMDOT-CADD-Stds-2018.pdf"
If My.Computer.FileSystem.FileExists(fn) Then
System.Diagnostics.Process.Start(fn)
Else
MsgBox("CADD Standards not found." & vbCrLf & "Please contact CADD Support", vbOKOnly)
End If
End Sub
<CommandMethod("NMDOTDesignStandards")>
Public Sub NMDOTDesignStandards()
Dim fn As String
fn = "S:\support\docs\NMDOT-Design-Standards-2018.pdf"
If My.Computer.FileSystem.FileExists(fn) Then
System.Diagnostics.Process.Start(fn)
Else
MsgBox("Design Standards not found." & vbCrLf & "Please contact CADD Support", vbOKOnly)
End If
End Sub
<CommandMethod("bug")>
Public Sub bug()
Dim fn As String
fn = "S:\support\docs\NMDOTBridgeUserGuide.pdf"
If My.Computer.FileSystem.FileExists(fn) Then
System.Diagnostics.Process.Start(fn)
Else
MsgBox("Bridge User Guide not found." & vbCrLf & "Please contact CADD Support", vbOKOnly)
End If
End Sub
<CommandMethod("NMDOTRequestForm")>
Public Sub NMDOTRequestForm()
Dim frm As TemplateRequest = New TemplateRequest
Dim dr As DialogResult
dr = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(frm)
End Sub
<CommandMethod("NMDOTDataShortcuts")>
Public Sub NMDOTDataShortcuts()
Dim frm As DataShortcuts = New DataShortcuts
Dim dr As DialogResult
dr = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(frm)
End Sub
'---------Bridge Palettes Section---------
<CommandMethod("bd")>
Public Sub bd()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\BridgeDynamic")
End Sub
<CommandMethod("bb")>
Public Sub bb()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Core.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\BridgeBlocks")
End Sub
<CommandMethod("bt")>
Public Sub bt()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\BridgeTools")
End Sub
'---------End of Bridge Palettes Section--------
'---------Roadway Palettes Section----------
<CommandMethod("rb")>
Public Sub rb()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\RoadwayBlocks")
End Sub
<CommandMethod("rcom")>
Public Sub rcom()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\RoadwayCommonSubs")
End Sub
<CommandMethod("rcus")>
Public Sub rcus()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\NMDOTcustomSubs")
End Sub
'---------Standard Location for Palettes---------
<CommandMethod("tps")>
Public Sub tps()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim defPath As String = "S:\Autodesk\Support\Palettes\Stock"
ed.Command("*_ToolPalettePath", defPath)
End Sub
<CommandMethod("changeUnits")>
Public Sub changeUnits()
Dim frm As DWGUnits = New DWGUnits
Dim dr As DialogResult
dr = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(frm)
End Sub
'----Traffic Palettes Section----
<CommandMethod("tGS")>
Public Sub tGS()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-GuideSigns")
End Sub
<CommandMethod("tOMS")>
Public Sub tOMS()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-ObjectMarkersSigns")
End Sub
<CommandMethod("tPSign")>
Public Sub tPSign()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-PermanentSigning")
End Sub
<CommandMethod("tPSt")>
Public Sub tPSt()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-PermanentStriping")
End Sub
<CommandMethod("tRS")>
Public Sub tRS()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-RegulatorySigns")
End Sub
<CommandMethod("tSS")>
Public Sub tSS()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-SchoolSigns")
End Sub
<CommandMethod("traffic")>
Public Sub traffic()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-Traffic")
End Sub
<CommandMethod("tCP")>
Public Sub tCP()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-TrafficControlPlan")
End Sub
<CommandMethod("tCC")>
Public Sub tCC()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-TrafficControlChannelization")
End Sub
<CommandMethod("tCS")>
Public Sub tCS()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-TrafficControlSigns")
End Sub
<CommandMethod("tWS")>
Public Sub tWS()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-WarningSigns")
End Sub
<CommandMethod("tW1")>
Public Sub tW1()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W1")
End Sub
<CommandMethod("tW2W3")>
Public Sub tW2W3()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W2-W3")
End Sub
<CommandMethod("tW4W5")>
Public Sub tW4W5()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W4-W5")
End Sub
<CommandMethod("tW6W7")>
Public Sub tW6W7()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W6-W7")
End Sub
<CommandMethod("tW8W9")>
Public Sub tW8W9()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W8-W9")
End Sub
<CommandMethod("tW10")>
Public Sub tW10()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W10")
End Sub
<CommandMethod("tW11W12")>
Public Sub tW11W12()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W11-W12")
End Sub
<CommandMethod("tW13W15")>
Public Sub tW13W15()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W13-W14-W15")
End Sub
<CommandMethod("tW16W18")>
Public Sub tW16W18()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W16-W17-W18")
End Sub
<CommandMethod("tW20")>
Public Sub tW20()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W20")
End Sub
<CommandMethod("tW21W23")>
Public Sub tW21W23()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W21-W22-W23")
End Sub
<CommandMethod("tW24W25")>
Public Sub tW24W25()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\Traffic\NMDOT-W24-W25")
End Sub
<CommandMethod("CivilMultiView")>
Public Sub CivilMultiView()
Dim acDoc As Document = Core.Application.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._Toolpalettes ", True, False, False)
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.Command("*_ToolPalettePath", "S:\Autodesk\Support\Palettes\CivilMultiview")
End Sub
<CommandMethod("UserNotification")>
Public Sub UserNotification()
Dim ServerMessage As String = "\\eabrn1\cadd\support\docs\Civil3DMessage.txt"
Dim ServerMessLog As String = "\\eabrn1\cadd\support\docs\CommunicationLog.txt"
If My.Computer.FileSystem.FileExists(ServerMessage) Then
'Get registry value for last message received by user
Dim LastMessage As Object
LastMessage = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Environment", "C3DlastMessage", Nothing)
'Get last edit date from file on server
Dim FDate = IO.File.GetLastWriteTime(ServerMessage).ToString("yyyy-MM-dd")
'If dates match, exit
If FDate = LastMessage Then Exit Sub
'Call dialog to display message
Dim cForm As Communication = New Communication
Dim dr1 As DialogResult
dr1 = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(cForm)
End If
End Sub
End Class