solidworks-mcp-server 2.0.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +75 -8
  3. package/dist/db/connection.d.ts.map +1 -1
  4. package/dist/db/connection.js.map +1 -1
  5. package/dist/knowledge/chromadb.js +1 -1
  6. package/dist/knowledge/chromadb.js.map +1 -1
  7. package/dist/resources/design-table.d.ts +16 -16
  8. package/dist/resources/design-table.d.ts.map +1 -1
  9. package/dist/resources/design-table.js +2 -2
  10. package/dist/resources/design-table.js.map +1 -1
  11. package/dist/resources/pdm.d.ts +43 -43
  12. package/dist/resources/pdm.d.ts.map +1 -1
  13. package/dist/resources/pdm.js +8 -8
  14. package/dist/resources/pdm.js.map +1 -1
  15. package/dist/solidworks/api.d.ts +15 -14
  16. package/dist/solidworks/api.d.ts.map +1 -1
  17. package/dist/solidworks/api.js +343 -71
  18. package/dist/solidworks/api.js.map +1 -1
  19. package/dist/tools/analysis.d.ts +4 -4
  20. package/dist/tools/analysis.d.ts.map +1 -1
  21. package/dist/tools/analysis.js +10 -15
  22. package/dist/tools/analysis.js.map +1 -1
  23. package/dist/tools/drawing.d.ts +5 -5
  24. package/dist/tools/drawing.d.ts.map +1 -1
  25. package/dist/tools/drawing.js +5 -5
  26. package/dist/tools/drawing.js.map +1 -1
  27. package/dist/tools/export.d.ts +4 -4
  28. package/dist/tools/export.d.ts.map +1 -1
  29. package/dist/tools/export.js +8 -8
  30. package/dist/tools/export.js.map +1 -1
  31. package/dist/tools/modeling.d.ts +1 -1
  32. package/dist/tools/modeling.d.ts.map +1 -1
  33. package/dist/tools/modeling.js +71 -15
  34. package/dist/tools/modeling.js.map +1 -1
  35. package/dist/tools/vba-advanced.d.ts +228 -0
  36. package/dist/tools/vba-advanced.d.ts.map +1 -0
  37. package/dist/tools/vba-advanced.js +787 -0
  38. package/dist/tools/vba-advanced.js.map +1 -0
  39. package/dist/tools/vba-assembly.d.ts +143 -0
  40. package/dist/tools/vba-assembly.d.ts.map +1 -0
  41. package/dist/tools/vba-assembly.js +588 -0
  42. package/dist/tools/vba-assembly.js.map +1 -0
  43. package/dist/tools/vba-drawing.d.ts +350 -0
  44. package/dist/tools/vba-drawing.d.ts.map +1 -0
  45. package/dist/tools/vba-drawing.js +695 -0
  46. package/dist/tools/vba-drawing.js.map +1 -0
  47. package/dist/tools/vba-file-management.d.ts +156 -0
  48. package/dist/tools/vba-file-management.d.ts.map +1 -0
  49. package/dist/tools/vba-file-management.js +655 -0
  50. package/dist/tools/vba-file-management.js.map +1 -0
  51. package/dist/tools/vba-part.d.ts +187 -0
  52. package/dist/tools/vba-part.d.ts.map +1 -0
  53. package/dist/tools/vba-part.js +516 -0
  54. package/dist/tools/vba-part.js.map +1 -0
  55. package/dist/tools/vba.d.ts +1037 -9
  56. package/dist/tools/vba.d.ts.map +1 -1
  57. package/dist/tools/vba.js +94 -26
  58. package/dist/tools/vba.js.map +1 -1
  59. package/dist/utils/logger.js +2 -2
  60. package/dist/utils/logger.js.map +1 -1
  61. package/package.json +6 -3
  62. package/scripts/setup.js +71 -0
@@ -0,0 +1,655 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * VBA Generation for File Management and PDM Operations
4
+ * Comprehensive file operations, batch processing, and PDM integration
5
+ */
6
+ export const fileManagementVBATools = [
7
+ {
8
+ name: 'vba_batch_operations',
9
+ description: 'Generate VBA for batch file operations',
10
+ inputSchema: z.object({
11
+ operation: z.enum([
12
+ 'open_all', 'save_all', 'export_all', 'convert_format',
13
+ 'update_references', 'pack_and_go', 'rename_files'
14
+ ]),
15
+ sourcePath: z.string().describe('Source folder path'),
16
+ destinationPath: z.string().optional().describe('Destination folder path'),
17
+ fileFilter: z.string().optional().describe('File filter (e.g., "*.sldprt")'),
18
+ exportFormat: z.enum(['step', 'iges', 'stl', 'pdf', 'dwg', 'parasolid']).optional(),
19
+ includeSubfolders: z.boolean().optional().default(false),
20
+ options: z.record(z.any()).optional()
21
+ }),
22
+ handler: (args) => {
23
+ const operations = {
24
+ open_all: `
25
+ Sub BatchOpenFiles()
26
+ Dim swApp As SldWorks.SldWorks
27
+ Dim swModel As SldWorks.ModelDoc2
28
+ Dim fso As Object
29
+ Dim folder As Object
30
+ Dim file As Object
31
+ Dim filePath As String
32
+ Dim errors As Long, warnings As Long
33
+ Dim processedCount As Integer
34
+
35
+ Set swApp = Application.SldWorks
36
+ Set fso = CreateObject("Scripting.FileSystemObject")
37
+ Set folder = fso.GetFolder("${args.sourcePath}")
38
+
39
+ processedCount = 0
40
+
41
+ ' Process each file
42
+ For Each file In folder.Files
43
+ If file.Name Like "${args.fileFilter || '*.sld*'}" Then
44
+ filePath = file.Path
45
+
46
+ ' Open file
47
+ Set swModel = swApp.OpenDoc6( _
48
+ filePath, _
49
+ GetDocumentType(filePath), _
50
+ swOpenDocOptions_e.swOpenDocOptions_Silent, _
51
+ "", errors, warnings)
52
+
53
+ If Not swModel Is Nothing Then
54
+ processedCount = processedCount + 1
55
+ Debug.Print "Opened: " & file.Name
56
+ End If
57
+ End If
58
+ Next file
59
+
60
+ ${args.includeSubfolders ? `
61
+ ' Process subfolders
62
+ Dim subfolder As Object
63
+ For Each subfolder In folder.SubFolders
64
+ ' Recursive call for subfolders
65
+ ' Add recursive processing logic here
66
+ Next subfolder` : ''}
67
+
68
+ MsgBox "Batch open complete. Processed " & processedCount & " files"
69
+ End Sub
70
+
71
+ Function GetDocumentType(filePath As String) As Integer
72
+ Dim ext As String
73
+ ext = LCase(Right(filePath, 6))
74
+
75
+ If InStr(ext, "sldprt") > 0 Then
76
+ GetDocumentType = swDocumentTypes_e.swDocPART
77
+ ElseIf InStr(ext, "sldasm") > 0 Then
78
+ GetDocumentType = swDocumentTypes_e.swDocASSEMBLY
79
+ ElseIf InStr(ext, "slddrw") > 0 Then
80
+ GetDocumentType = swDocumentTypes_e.swDocDRAWING
81
+ Else
82
+ GetDocumentType = swDocumentTypes_e.swDocNONE
83
+ End If
84
+ End Function`,
85
+ export_all: `
86
+ Sub BatchExportFiles()
87
+ Dim swApp As SldWorks.SldWorks
88
+ Dim swModel As SldWorks.ModelDoc2
89
+ Dim fso As Object
90
+ Dim folder As Object
91
+ Dim file As Object
92
+ Dim filePath As String
93
+ Dim exportPath As String
94
+ Dim errors As Long, warnings As Long
95
+ Dim exportCount As Integer
96
+
97
+ Set swApp = Application.SldWorks
98
+ Set fso = CreateObject("Scripting.FileSystemObject")
99
+ Set folder = fso.GetFolder("${args.sourcePath}")
100
+
101
+ ' Create destination folder if needed
102
+ If Not fso.FolderExists("${args.destinationPath || args.sourcePath + '\\Exported'}") Then
103
+ fso.CreateFolder("${args.destinationPath || args.sourcePath + '\\Exported'}")
104
+ End If
105
+
106
+ exportCount = 0
107
+
108
+ For Each file In folder.Files
109
+ If file.Name Like "${args.fileFilter || '*.sld*'}" Then
110
+ filePath = file.Path
111
+
112
+ ' Open file
113
+ Set swModel = swApp.OpenDoc6( _
114
+ filePath, GetDocumentType(filePath), _
115
+ swOpenDocOptions_e.swOpenDocOptions_Silent, _
116
+ "", errors, warnings)
117
+
118
+ If Not swModel Is Nothing Then
119
+ ' Generate export path
120
+ exportPath = "${args.destinationPath || args.sourcePath + '\\Exported'}\\" & _
121
+ fso.GetBaseName(file.Name) & ".${args.exportFormat || 'step'}"
122
+
123
+ ' Export based on format
124
+ ${args.exportFormat === 'step' ? `
125
+ swModel.Extension.SaveAs3 exportPath, 0, _
126
+ swSaveAsOptions_e.swSaveAsOptions_Silent, _
127
+ Nothing, Nothing, errors, warnings` : ''}
128
+ ${args.exportFormat === 'stl' ? `
129
+ swModel.Extension.SaveAs3 exportPath, 0, _
130
+ swSaveAsOptions_e.swSaveAsOptions_Silent, _
131
+ Nothing, Nothing, errors, warnings` : ''}
132
+ ${args.exportFormat === 'pdf' ? `
133
+ Dim swExportPDFData As SldWorks.ExportPdfData
134
+ Set swExportPDFData = swApp.GetExportFileData(swExportDataFileType_e.swExportPdfData)
135
+ swModel.Extension.SaveAs3 exportPath, 0, _
136
+ swSaveAsOptions_e.swSaveAsOptions_Silent, _
137
+ swExportPDFData, Nothing, errors, warnings` : ''}
138
+
139
+ exportCount = exportCount + 1
140
+ Debug.Print "Exported: " & exportPath
141
+
142
+ ' Close file
143
+ swApp.CloseDoc swModel.GetPathName
144
+ End If
145
+ End If
146
+ Next file
147
+
148
+ MsgBox "Batch export complete. Exported " & exportCount & " files"
149
+ End Sub`,
150
+ pack_and_go: `
151
+ Sub BatchPackAndGo()
152
+ Dim swApp As SldWorks.SldWorks
153
+ Dim swModel As SldWorks.ModelDoc2
154
+ Dim swPackAndGo As SldWorks.PackAndGo
155
+ Dim fso As Object
156
+ Dim folder As Object
157
+ Dim file As Object
158
+ Dim filePath As String
159
+ Dim errors As Long, warnings As Long
160
+ Dim packCount As Integer
161
+
162
+ Set swApp = Application.SldWorks
163
+ Set fso = CreateObject("Scripting.FileSystemObject")
164
+ Set folder = fso.GetFolder("${args.sourcePath}")
165
+
166
+ packCount = 0
167
+
168
+ For Each file In folder.Files
169
+ If file.Name Like "${args.fileFilter || '*.sldasm'}" Then
170
+ filePath = file.Path
171
+
172
+ ' Open assembly
173
+ Set swModel = swApp.OpenDoc6( _
174
+ filePath, swDocumentTypes_e.swDocASSEMBLY, _
175
+ swOpenDocOptions_e.swOpenDocOptions_Silent, _
176
+ "", errors, warnings)
177
+
178
+ If Not swModel Is Nothing Then
179
+ ' Get Pack and Go
180
+ Set swPackAndGo = swModel.Extension.GetPackAndGo
181
+
182
+ ' Configure Pack and Go
183
+ swPackAndGo.IncludeDrawings = ${args.options?.includeDrawings ? 'True' : 'False'}
184
+ swPackAndGo.IncludeSimulationResults = ${args.options?.includeSimulation ? 'True' : 'False'}
185
+ swPackAndGo.IncludeToolboxComponents = ${args.options?.includeToolbox ? 'True' : 'False'}
186
+ swPackAndGo.FlattenToSingleFolder = ${args.options?.flattenFolders ? 'True' : 'False'}
187
+
188
+ ' Set destination
189
+ Dim destFolder As String
190
+ destFolder = "${args.destinationPath || args.sourcePath + '\\PackAndGo'}\\" & _
191
+ fso.GetBaseName(file.Name)
192
+
193
+ If Not fso.FolderExists(destFolder) Then
194
+ fso.CreateFolder(destFolder)
195
+ End If
196
+
197
+ swPackAndGo.SetSaveToName True, destFolder
198
+
199
+ ' Execute Pack and Go
200
+ Dim pgStatus As Long
201
+ pgStatus = swModel.Extension.SavePackAndGo(swPackAndGo)
202
+
203
+ If pgStatus = 0 Then
204
+ packCount = packCount + 1
205
+ Debug.Print "Packed: " & file.Name & " to " & destFolder
206
+ End If
207
+
208
+ swApp.CloseDoc swModel.GetPathName
209
+ End If
210
+ End If
211
+ Next file
212
+
213
+ MsgBox "Pack and Go complete. Processed " & packCount & " assemblies"
214
+ End Sub`
215
+ };
216
+ return operations[args.operation] || operations.open_all;
217
+ }
218
+ },
219
+ {
220
+ name: 'vba_custom_properties',
221
+ description: 'Generate VBA for managing custom properties',
222
+ inputSchema: z.object({
223
+ operation: z.enum(['add', 'modify', 'delete', 'copy', 'export', 'import']),
224
+ properties: z.array(z.object({
225
+ name: z.string(),
226
+ value: z.string(),
227
+ type: z.enum(['text', 'date', 'number', 'yesno']).optional(),
228
+ configuration: z.string().optional()
229
+ })).optional(),
230
+ sourcePath: z.string().optional(),
231
+ templatePath: z.string().optional(),
232
+ exportFormat: z.enum(['excel', 'csv', 'xml']).optional()
233
+ }),
234
+ handler: (args) => {
235
+ return `
236
+ Sub ManageCustomProperties_${args.operation}()
237
+ Dim swApp As SldWorks.SldWorks
238
+ Dim swModel As SldWorks.ModelDoc2
239
+ Dim swCustPropMgr As SldWorks.CustomPropertyManager
240
+ Dim propType As Long
241
+ Dim propValue As String
242
+ Dim evalValue As String
243
+ Dim bRet As Boolean
244
+
245
+ Set swApp = Application.SldWorks
246
+ Set swModel = swApp.ActiveDoc
247
+
248
+ If swModel Is Nothing Then
249
+ MsgBox "No active document"
250
+ Exit Sub
251
+ End If
252
+
253
+ ${args.operation === 'add' || args.operation === 'modify' ? `
254
+ ' Add/Modify properties
255
+ ${args.properties ? args.properties.map((prop) => `
256
+ ' Get property manager for configuration
257
+ Set swCustPropMgr = swModel.Extension.CustomPropertyManager("${prop.configuration || ''}")
258
+
259
+ ' Determine property type
260
+ ${prop.type === 'date' ? 'propType = swCustomInfoType_e.swCustomInfoDate' :
261
+ prop.type === 'number' ? 'propType = swCustomInfoType_e.swCustomInfoNumber' :
262
+ prop.type === 'yesno' ? 'propType = swCustomInfoType_e.swCustomInfoYesOrNo' :
263
+ 'propType = swCustomInfoType_e.swCustomInfoText'}
264
+
265
+ ' Add or modify property
266
+ bRet = swCustPropMgr.Add3( _
267
+ "${prop.name}", _
268
+ propType, _
269
+ "${prop.value}", _
270
+ swCustomPropertyAddOption_e.swCustomPropertyReplaceValue)
271
+
272
+ If bRet Then
273
+ Debug.Print "${args.operation === 'add' ? 'Added' : 'Modified'} property: ${prop.name} = ${prop.value}"
274
+ End If`).join('\n ') : ''}
275
+
276
+ MsgBox "Properties ${args.operation === 'add' ? 'added' : 'modified'} successfully"` : ''}
277
+
278
+ ${args.operation === 'delete' ? `
279
+ ' Delete properties
280
+ Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")
281
+
282
+ ${args.properties ? args.properties.map((prop) => `
283
+ bRet = swCustPropMgr.Delete2("${prop.name}")
284
+ If bRet Then
285
+ Debug.Print "Deleted property: ${prop.name}"
286
+ End If`).join('\n ') : ''}
287
+
288
+ MsgBox "Properties deleted"` : ''}
289
+
290
+ ${args.operation === 'export' ? `
291
+ ' Export properties to Excel
292
+ Dim xlApp As Object
293
+ Dim xlBook As Object
294
+ Dim xlSheet As Object
295
+ Dim propNames As Variant
296
+ Dim i As Integer
297
+
298
+ Set xlApp = CreateObject("Excel.Application")
299
+ Set xlBook = xlApp.Workbooks.Add
300
+ Set xlSheet = xlBook.Sheets(1)
301
+ xlApp.Visible = True
302
+
303
+ ' Headers
304
+ xlSheet.Cells(1, 1).Value = "Property Name"
305
+ xlSheet.Cells(1, 2).Value = "Value"
306
+ xlSheet.Cells(1, 3).Value = "Evaluated Value"
307
+ xlSheet.Cells(1, 4).Value = "Type"
308
+
309
+ ' Get all properties
310
+ Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")
311
+ propNames = swCustPropMgr.GetNames
312
+
313
+ If Not IsEmpty(propNames) Then
314
+ For i = 0 To UBound(propNames)
315
+ swCustPropMgr.Get4 propNames(i), False, propValue, evalValue
316
+
317
+ xlSheet.Cells(i + 2, 1).Value = propNames(i)
318
+ xlSheet.Cells(i + 2, 2).Value = propValue
319
+ xlSheet.Cells(i + 2, 3).Value = evalValue
320
+ xlSheet.Cells(i + 2, 4).Value = swCustPropMgr.GetType2(propNames(i))
321
+ Next i
322
+ End If
323
+
324
+ xlSheet.Columns.AutoFit
325
+
326
+ ${args.sourcePath ? `
327
+ xlBook.SaveAs "${args.sourcePath}"
328
+ MsgBox "Properties exported to: ${args.sourcePath}"` : ''}` : ''}
329
+
330
+ ${args.operation === 'copy' ? `
331
+ ' Copy properties from another file
332
+ Dim swSourceModel As SldWorks.ModelDoc2
333
+ Dim swSourceCustPropMgr As SldWorks.CustomPropertyManager
334
+ Dim errors As Long, warnings As Long
335
+
336
+ ' Open source file
337
+ Set swSourceModel = swApp.OpenDoc6( _
338
+ "${args.sourcePath}", _
339
+ GetDocumentType("${args.sourcePath}"), _
340
+ swOpenDocOptions_e.swOpenDocOptions_Silent, _
341
+ "", errors, warnings)
342
+
343
+ If Not swSourceModel Is Nothing Then
344
+ Set swSourceCustPropMgr = swSourceModel.Extension.CustomPropertyManager("")
345
+ Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")
346
+
347
+ propNames = swSourceCustPropMgr.GetNames
348
+
349
+ If Not IsEmpty(propNames) Then
350
+ For i = 0 To UBound(propNames)
351
+ swSourceCustPropMgr.Get4 propNames(i), False, propValue, evalValue
352
+ propType = swSourceCustPropMgr.GetType2(propNames(i))
353
+
354
+ swCustPropMgr.Add3 propNames(i), propType, propValue, _
355
+ swCustomPropertyAddOption_e.swCustomPropertyReplaceValue
356
+
357
+ Debug.Print "Copied property: " & propNames(i)
358
+ Next i
359
+ End If
360
+
361
+ swApp.CloseDoc swSourceModel.GetPathName
362
+ MsgBox "Properties copied from source file"
363
+ End If` : ''}
364
+ End Sub`;
365
+ }
366
+ },
367
+ {
368
+ name: 'vba_pdm_operations',
369
+ description: 'Generate VBA for PDM vault operations',
370
+ inputSchema: z.object({
371
+ operation: z.enum([
372
+ 'check_in', 'check_out', 'get_latest', 'add_file',
373
+ 'change_state', 'search', 'copy_tree'
374
+ ]),
375
+ vaultName: z.string(),
376
+ filePath: z.string().optional(),
377
+ comment: z.string().optional(),
378
+ stateName: z.string().optional(),
379
+ searchCriteria: z.record(z.string()).optional(),
380
+ includeChildren: z.boolean().optional().default(true)
381
+ }),
382
+ handler: (args) => {
383
+ return `
384
+ Sub PDMOperation_${args.operation}()
385
+ Dim pdmVault As Object ' EdmVault5
386
+ Dim pdmFile As Object ' IEdmFile5
387
+ Dim pdmFolder As Object ' IEdmFolder5
388
+ Dim pdmSearch As Object ' IEdmSearch5
389
+ Dim pdmSearchResult As Object ' IEdmSearchResult5
390
+ Dim bRet As Boolean
391
+
392
+ ' Create PDM vault object
393
+ Set pdmVault = CreateObject("ConisioLib.EdmVault")
394
+
395
+ ' Login to vault
396
+ pdmVault.LoginAuto "${args.vaultName}", 0
397
+
398
+ If Not pdmVault.IsLoggedIn Then
399
+ MsgBox "Failed to login to PDM vault: ${args.vaultName}"
400
+ Exit Sub
401
+ End If
402
+
403
+ ${args.operation === 'check_out' ? `
404
+ ' Check out file
405
+ Set pdmFolder = pdmVault.GetFolderFromPath(Left("${args.filePath}", InStrRev("${args.filePath}", "\\")))
406
+ Set pdmFile = pdmFolder.GetFile(Mid("${args.filePath}", InStrRev("${args.filePath}", "\\") + 1))
407
+
408
+ If Not pdmFile Is Nothing Then
409
+ ' Check if already checked out
410
+ If Not pdmFile.IsLocked Then
411
+ pdmFile.LockFile pdmFolder.ID, 0
412
+ MsgBox "File checked out: " & pdmFile.Name
413
+ Else
414
+ MsgBox "File is already checked out"
415
+ End If
416
+ Else
417
+ MsgBox "File not found in vault"
418
+ End If` : ''}
419
+
420
+ ${args.operation === 'check_in' ? `
421
+ ' Check in file
422
+ Set pdmFolder = pdmVault.GetFolderFromPath(Left("${args.filePath}", InStrRev("${args.filePath}", "\\")))
423
+ Set pdmFile = pdmFolder.GetFile(Mid("${args.filePath}", InStrRev("${args.filePath}", "\\") + 1))
424
+
425
+ If Not pdmFile Is Nothing Then
426
+ If pdmFile.IsLocked Then
427
+ ' Check in with comment
428
+ pdmFile.UnlockFile 0, "${args.comment || 'Checked in via VBA'}", _
429
+ ${args.includeChildren ? '1' : '0'}
430
+ MsgBox "File checked in: " & pdmFile.Name
431
+ Else
432
+ MsgBox "File is not checked out"
433
+ End If
434
+ End If` : ''}
435
+
436
+ ${args.operation === 'get_latest' ? `
437
+ ' Get latest version
438
+ Set pdmFolder = pdmVault.GetFolderFromPath(Left("${args.filePath}", InStrRev("${args.filePath}", "\\")))
439
+ Set pdmFile = pdmFolder.GetFile(Mid("${args.filePath}", InStrRev("${args.filePath}", "\\") + 1))
440
+
441
+ If Not pdmFile Is Nothing Then
442
+ pdmFile.GetFileCopy 0
443
+ MsgBox "Got latest version of: " & pdmFile.Name
444
+ End If` : ''}
445
+
446
+ ${args.operation === 'change_state' ? `
447
+ ' Change workflow state
448
+ Set pdmFolder = pdmVault.GetFolderFromPath(Left("${args.filePath}", InStrRev("${args.filePath}", "\\")))
449
+ Set pdmFile = pdmFolder.GetFile(Mid("${args.filePath}", InStrRev("${args.filePath}", "\\") + 1))
450
+
451
+ If Not pdmFile Is Nothing Then
452
+ Dim pdmStateMgr As Object
453
+ Set pdmStateMgr = pdmFile.GetNextState("${args.stateName}")
454
+
455
+ If Not pdmStateMgr Is Nothing Then
456
+ pdmFile.ChangeState pdmStateMgr.ID, pdmFolder.ID, _
457
+ "${args.comment || 'State changed via VBA'}", 0, 0
458
+ MsgBox "State changed to: ${args.stateName}"
459
+ Else
460
+ MsgBox "State not found: ${args.stateName}"
461
+ End If
462
+ End If` : ''}
463
+
464
+ ${args.operation === 'search' ? `
465
+ ' Search vault
466
+ Set pdmSearch = pdmVault.CreateSearch
467
+
468
+ ' Set search criteria
469
+ ${args.searchCriteria ? Object.entries(args.searchCriteria).map(([key, value]) => `
470
+ pdmSearch.SetToken EdmSearchToken_e.${key}, "${value}"`).join('\n ') : ''}
471
+
472
+ ' Execute search
473
+ Set pdmSearchResult = pdmSearch.GetFirstResult
474
+
475
+ Dim results As String
476
+ results = "Search Results:" & vbCrLf
477
+
478
+ While Not pdmSearchResult Is Nothing
479
+ results = results & pdmSearchResult.Path & vbCrLf
480
+ Set pdmSearchResult = pdmSearch.GetNextResult
481
+ Wend
482
+
483
+ MsgBox results` : ''}
484
+
485
+ ' Logout
486
+ pdmVault.Logout
487
+ End Sub
488
+
489
+ ' Helper function for file type
490
+ Private Function GetDocumentType(filePath As String) As Integer
491
+ Dim ext As String
492
+ ext = LCase(Right(filePath, 6))
493
+
494
+ If InStr(ext, "sldprt") > 0 Then
495
+ GetDocumentType = 1 ' Part
496
+ ElseIf InStr(ext, "sldasm") > 0 Then
497
+ GetDocumentType = 2 ' Assembly
498
+ ElseIf InStr(ext, "slddrw") > 0 Then
499
+ GetDocumentType = 3 ' Drawing
500
+ Else
501
+ GetDocumentType = 0 ' Unknown
502
+ End If
503
+ End Function`;
504
+ }
505
+ },
506
+ {
507
+ name: 'vba_design_table',
508
+ description: 'Generate VBA for creating and managing design tables',
509
+ inputSchema: z.object({
510
+ operation: z.enum(['create', 'update', 'export', 'import', 'link_excel']),
511
+ tableName: z.string(),
512
+ parameters: z.array(z.object({
513
+ name: z.string(),
514
+ type: z.enum(['dimension', 'feature', 'component', 'custom_property']),
515
+ configurations: z.record(z.any()).optional()
516
+ })).optional(),
517
+ excelPath: z.string().optional(),
518
+ linkToExternal: z.boolean().optional()
519
+ }),
520
+ handler: (args) => {
521
+ return `
522
+ Sub ManageDesignTable_${args.operation}()
523
+ Dim swApp As SldWorks.SldWorks
524
+ Dim swModel As SldWorks.ModelDoc2
525
+ Dim swDesignTable As SldWorks.DesignTable
526
+ Dim swFeature As SldWorks.Feature
527
+ Dim xlApp As Object
528
+ Dim xlBook As Object
529
+ Dim xlSheet As Object
530
+ Dim i As Integer, j As Integer
531
+
532
+ Set swApp = Application.SldWorks
533
+ Set swModel = swApp.ActiveDoc
534
+
535
+ If swModel Is Nothing Then
536
+ MsgBox "No active document"
537
+ Exit Sub
538
+ End If
539
+
540
+ ${args.operation === 'create' ? `
541
+ ' Create design table
542
+ Set xlApp = CreateObject("Excel.Application")
543
+ Set xlBook = xlApp.Workbooks.Add
544
+ Set xlSheet = xlBook.Sheets(1)
545
+
546
+ ' Set up headers
547
+ xlSheet.Cells(1, 1).Value = "Configuration"
548
+
549
+ ${args.parameters ? args.parameters.map((param, i) => `
550
+ ' Add parameter header
551
+ xlSheet.Cells(1, ${i + 2}).Value = "${param.name}@${param.type === 'dimension' ? 'Sketch1' : param.type === 'feature' ? 'Feature' : 'CustomProperty'}"
552
+
553
+ ' Add configuration values
554
+ ${param.configurations ? Object.entries(param.configurations).map(([config, value], j) => `
555
+ xlSheet.Cells(${j + 2}, 1).Value = "${config}"
556
+ xlSheet.Cells(${j + 2}, ${i + 2}).Value = "${value}"`).join('\n ') : ''}`).join('\n ') : ''}
557
+
558
+ ' Save Excel file
559
+ Dim tempPath As String
560
+ tempPath = Environ("TEMP") & "\\DesignTable_${args.tableName}.xlsx"
561
+ xlBook.SaveAs tempPath
562
+ xlApp.Quit
563
+
564
+ ' Insert design table
565
+ Set swDesignTable = swModel.InsertDesignTable( _
566
+ ${args.linkToExternal ? 'True' : 'False'}, _
567
+ ${args.linkToExternal ? 'True' : 'False'}, _
568
+ ${args.linkToExternal ? '2' : '1'}, _
569
+ tempPath)
570
+
571
+ If Not swDesignTable Is Nothing Then
572
+ MsgBox "Design table created: ${args.tableName}"
573
+ End If` : ''}
574
+
575
+ ${args.operation === 'update' ? `
576
+ ' Update existing design table
577
+ Set swDesignTable = swModel.GetDesignTable
578
+
579
+ If Not swDesignTable Is Nothing Then
580
+ ' Edit design table
581
+ swDesignTable.Edit
582
+
583
+ ' Get Excel object
584
+ Set xlApp = GetObject(, "Excel.Application")
585
+ Set xlBook = xlApp.ActiveWorkbook
586
+ Set xlSheet = xlBook.ActiveSheet
587
+
588
+ ' Update values
589
+ ${args.parameters ? args.parameters.map((param) => `
590
+ ' Find and update parameter column
591
+ For j = 1 To xlSheet.UsedRange.Columns.Count
592
+ If xlSheet.Cells(1, j).Value = "${param.name}@Sketch1" Then
593
+ ${param.configurations ? Object.entries(param.configurations).map(([config, value], i) => `
594
+ ' Update configuration value
595
+ For i = 2 To xlSheet.UsedRange.Rows.Count
596
+ If xlSheet.Cells(i, 1).Value = "${config}" Then
597
+ xlSheet.Cells(i, j).Value = "${value}"
598
+ End If
599
+ Next i`).join('\n ') : ''}
600
+ End If
601
+ Next j`).join('\n ') : ''}
602
+
603
+ ' Close design table
604
+ swDesignTable.UpdateModel swDesignTableUpdateOptions_e.swUpdateDesignTableAll
605
+
606
+ MsgBox "Design table updated"
607
+ Else
608
+ MsgBox "No design table found"
609
+ End If` : ''}
610
+
611
+ ${args.operation === 'export' ? `
612
+ ' Export design table
613
+ Set swDesignTable = swModel.GetDesignTable
614
+
615
+ If Not swDesignTable Is Nothing Then
616
+ ' Edit to access Excel
617
+ swDesignTable.Edit
618
+
619
+ Set xlApp = GetObject(, "Excel.Application")
620
+ Set xlBook = xlApp.ActiveWorkbook
621
+
622
+ ' Save to new location
623
+ xlBook.SaveAs "${args.excelPath || 'C:\\Temp\\ExportedDesignTable.xlsx'}"
624
+
625
+ ' Close design table
626
+ swDesignTable.UpdateModel swDesignTableUpdateOptions_e.swUpdateDesignTableAll
627
+
628
+ MsgBox "Design table exported to: ${args.excelPath || 'C:\\Temp\\ExportedDesignTable.xlsx'}"
629
+ End If` : ''}
630
+
631
+ ${args.operation === 'link_excel' ? `
632
+ ' Link to external Excel file
633
+ Set swDesignTable = swModel.GetDesignTable
634
+
635
+ If Not swDesignTable Is Nothing Then
636
+ ' Delete existing table
637
+ Set swFeature = swDesignTable
638
+ swFeature.Select2 False, 0
639
+ swModel.EditDelete
640
+ End If
641
+
642
+ ' Insert linked design table
643
+ Set swDesignTable = swModel.InsertDesignTable( _
644
+ True, True, 2, "${args.excelPath}")
645
+
646
+ If Not swDesignTable Is Nothing Then
647
+ MsgBox "Design table linked to: ${args.excelPath}"
648
+ End If` : ''}
649
+
650
+ swModel.EditRebuild3
651
+ End Sub`;
652
+ }
653
+ }
654
+ ];
655
+ //# sourceMappingURL=vba-file-management.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vba-file-management.js","sourceRoot":"","sources":["../../src/tools/vba-file-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,wCAAwC;QACrD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC;gBAChB,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB;gBACtD,mBAAmB,EAAE,aAAa,EAAE,cAAc;aACnD,CAAC;YACF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YACrD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;YAC1E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;YAC5E,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,K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