-
Notifications
You must be signed in to change notification settings - Fork 0
/
LabelToAction.vb
1983 lines (1822 loc) · 97.4 KB
/
LabelToAction.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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Option Strict On
'Imports Microsoft.WindowsAPICodePack.Shell.PropertySystem.SystemProperties.System
'Imports SolidEdgePart
' The order on the CheckBoxLists is set by the order of creation of the L2A objects.
Public Class LabelToAction
Inherits Dictionary(Of String, L2A)
Public Class L2A
Public Property LabelText As String
Public Property HelpText As String
Public Property RequiresTemplate As Boolean
Public Property RequiresMaterialTable As Boolean
Public Property RequiresLaserOutputDirectory As Boolean
Public Property RequiresPartNumberFields As Boolean
Public Property RequiresSave As Boolean
Public Property RequiresSaveAsOutputDirectory As Boolean
Public Property IncompatibleWithOtherTasks As Boolean
Public Property RequiresExternalProgram As Boolean
Public Property RequiresSaveAsFlatDXFOutputDirectory As Boolean
Public Property RequiresFindReplaceFields As Boolean
Public Property RequiresPrinter As Boolean
Public Property RequiresPictorialView As Boolean
Public Property RequiresForegroundProcessing As Boolean
Public Property RequiresVariablesToEdit As Boolean
Public Property RequiresOverallSizeVariables As Boolean
Public Property AppliesToAssembly As Boolean
Public Property AppliesToPart As Boolean
Public Property AppliesToSheetmetal As Boolean
Public Property AppliesToDraft As Boolean
Public Property HasOptions As Boolean
Public Property HelpURL As String
End Class
Public Sub New()
Populate()
'If Filetype = "Assembly" Then
' PopulateAssembly()
'ElseIf Filetype = "Part" Then
' PopulatePart()
'ElseIf Filetype = "Sheetmetal" Then
' PopulateSheetmetal()
'ElseIf Filetype = "Draft" Then
' PopulateDraft()
'Else
' MsgBox("Filetype not recognized: " + Filetype + ". Exiting...")
' End
'End If
End Sub
Public Sub PopulateList(Entry As L2A,
TaskName As String,
LabelText As String,
HelpText As String,
AppliesToAssembly As Boolean,
AppliesToPart As Boolean,
AppliesToSheetmetal As Boolean,
AppliesToDraft As Boolean,
HasOptions As Boolean,
Optional RequiresTemplate As Boolean = False,
Optional RequiresMaterialTable As Boolean = False,
Optional RequiresLaserOutputDirectory As Boolean = False,
Optional RequiresPartNumberFields As Boolean = False,
Optional RequiresSave As Boolean = False,
Optional RequiresSaveAsOutputDirectory As Boolean = False,
Optional IncompatibleWithOtherTasks As Boolean = False,
Optional RequiresExternalProgram As Boolean = False,
Optional RequiresSaveAsFlatDXFOutputDirectory As Boolean = False,
Optional RequiresFindReplaceFields As Boolean = False,
Optional RequiresPrinter As Boolean = False,
Optional RequiresPictorialView As Boolean = False,
Optional RequiresForegroundProcessing As Boolean = False,
Optional RequiresVariablesToEdit As Boolean = False,
Optional RequiresOverallSizeVariables As Boolean = False,
Optional HelpURL As String = "https://github.com/rmcanany/SolidEdgeHousekeeper#readme")
Entry.LabelText = LabelText
Entry.HelpText = HelpText
Entry.AppliesToAssembly = AppliesToAssembly
Entry.AppliesToPart = AppliesToPart
Entry.AppliesToSheetmetal = AppliesToSheetmetal
Entry.AppliesToDraft = AppliesToDraft
Entry.HasOptions = HasOptions
Entry.RequiresTemplate = RequiresTemplate
Entry.RequiresMaterialTable = RequiresMaterialTable
Entry.RequiresLaserOutputDirectory = RequiresLaserOutputDirectory
Entry.RequiresPartNumberFields = RequiresPartNumberFields
Entry.RequiresSave = RequiresSave
Entry.RequiresSaveAsOutputDirectory = RequiresSaveAsOutputDirectory
Entry.IncompatibleWithOtherTasks = IncompatibleWithOtherTasks
Entry.RequiresExternalProgram = RequiresExternalProgram
Entry.RequiresSaveAsFlatDXFOutputDirectory = RequiresSaveAsFlatDXFOutputDirectory
Entry.RequiresFindReplaceFields = RequiresFindReplaceFields
Entry.RequiresPrinter = RequiresPrinter
Entry.RequiresPictorialView = RequiresPictorialView
Entry.RequiresForegroundProcessing = RequiresForegroundProcessing
Entry.RequiresVariablesToEdit = RequiresVariablesToEdit
Entry.RequiresOverallSizeVariables = RequiresOverallSizeVariables
Entry.HelpURL = HelpURL
Me(TaskName) = Entry
End Sub
Private Sub Populate()
Dim TaskName As String
Dim LabelText As String
Dim HelpString As String
Dim AppliesToAssembly As Boolean
Dim AppliesToPart As Boolean
Dim AppliesToSheetmetal As Boolean
Dim AppliesToDraft As Boolean
Dim HasOptions As Boolean
Dim HelpURL As String
Dim OpenSave As New L2A
TaskName = "OpenSave"
LabelText = "Open/Save"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Open a document and save in the current version."
PopulateList(OpenSave,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim ActivateAndUpdateAll As New L2A
TaskName = "ActivateAndUpdateAll"
LabelText = "Activate and update all"
AppliesToAssembly = True
AppliesToPart = False
AppliesToSheetmetal = False
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Loads all assembly occurrences' geometry into memory and does an update. "
HelpString += "Used mainly to eliminate the gray corners on assembly drawings. "
HelpString += vbCrLf + vbCrLf + "Can run out of memory for very large assemblies."
PopulateList(ActivateAndUpdateAll,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim PropertyFindReplace As New L2A
TaskName = "PropertyFindReplace"
LabelText = "Property find/replace"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Searches for text in a specified property and replaces it if found. "
HelpString += "The property, search text, and replacement text are entered on the Input Editor. "
HelpString += "Activate the editor using the `Property find/replace` `Edit` button on the **Task Tab** below the task list. "
HelpString += ""
HelpString += vbCrLf + vbCrLf + "![Find_Replace](My%20Project/media/property_input_editor.png)"
HelpString += ""
HelpString += vbCrLf + vbCrLf + "A `Property set`, either `System` or `Custom`, is required. "
HelpString += "For more information, see the **Property Filter** section above. "
HelpString += vbCrLf + vbCrLf + "There are three search modes, `PT`, `WC`, and `RX`. "
HelpString += vbCrLf + vbCrLf + "- `PT` stands for 'Plain Text'. It is simple to use, but finds literal matches only. "
HelpString += vbCrLf + "- `WC` stands for 'Wild Card'. You use `*`, `?` `[charlist]`, and `[!charlist]` according to the VB Like syntax. "
HelpString += vbCrLf + "- `RX` stands for 'Regex'. It is a more comprehensive (and notoriously cryptic) method of matching text. "
HelpString += "Check the [<ins>**.NET Regex Guide**</ins>](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference) "
HelpString += "for more information."
HelpString += vbCrLf + vbCrLf + "The search *is not* case sensitive, the replacement *is*. "
HelpString += "For example, say the search is `aluminum`, "
HelpString += "the replacement is `ALUMINUM`, "
HelpString += "and the property value is `Aluminum 6061-T6`. "
HelpString += "Then the new value would be `ALUMINUM 6061-T6`. "
' HelpString += vbCrLf + vbCrLf + "![Property Formula](My%20Project/media/property_formula.png)"
HelpString += vbCrLf + vbCrLf + "In addition to plain text and pattern matching, you can also use "
HelpString += "a property formula. The formula has the same syntax as the Callout command, "
HelpString += "except preceeded with `System.` or `Custom.` as shown in the Input Editor above. "
HelpString += vbCrLf + vbCrLf + "If the specified property does not exist in the file, "
HelpString += "you can optionally have it added automatically. "
HelpString += "This option is set on the **Configuration Tab -- General Page**. "
HelpString += "Note, this only works for `Custom` properties. Adding `System` properties is not allowed. "
HelpString += vbCrLf + vbCrLf + "If you are changing `System.Material` specifically, there is an option "
HelpString += "to automatically update the part's material properties (density, face styles, etc.). "
HelpString += "Set the option on the **Configuration Tab -- General Page**. "
HelpString += vbCrLf + vbCrLf + "The properties are processed in the order in the table. "
HelpString += "You can change the order by selecting a row and using the Up/Down buttons "
HelpString += "at the top of the form. Only one row can be moved at a time. "
HelpString += "The delete button, also at the top of the form, removes selected rows. "
HelpString += vbCrLf + vbCrLf + "You can copy the settings on the form to other tabs. "
HelpString += "Set the `Copy To` CheckBoxes as desired."
HelpString += vbCrLf + vbCrLf + "Note the textbox adjacent to the `Edit` button "
HelpString += "is a `Dictionary` representation of the table settings in `JSON` format. "
HelpString += "You can edit it if you want, but the form is probably easier to use. "
PopulateList(PropertyFindReplace,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresFindReplaceFields:=True, RequiresSave:=True)
Dim UpdatePhysicalProperties As New L2A
TaskName = "UpdatePhysicalProperties"
LabelText = "Update physical properties"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Updates mass, volume, etc. Models with no density are reported in the log file. "
HelpString += vbCrLf + vbCrLf + "You can optionally control the display of the center of mass symbol. "
HelpString += "It can either be shown, hidden, or left unchanged. "
HelpString += "The option is set on the **Configuration Tab -- General Page**. "
HelpString += "To leave the symbol's display unchanged, "
HelpString += "disable both the `Show` and `Hide` options. "
HelpString += "Note, controlling the symbol display only works for assembly files at this time. "
HelpString += vbCrLf + vbCrLf + "Occasionally, the physical properties are updated correctly, "
HelpString += "but the results are not carried over to the Variable Table. "
HelpString += "The error is detected and reported in the log file. The easiest fix I've found "
HelpString += "is to open the file in SE, change the material, then change it right back. "
HelpString += "You can verify if it worked by checking for `Mass` in the Variable Table. "
PopulateList(UpdatePhysicalProperties,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim VariablesEdit As New L2A
TaskName = "VariablesEdit"
LabelText = "Variables add/edit/expose"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Adds, changes, and/or exposes variables. The information is entered on the Input Editor. "
HelpString += "Access the form using the `Variables edit/add/expose` `Edit` button. "
HelpString += "It is located below the task list on each **Task Tab**."
HelpString += vbCrLf + vbCrLf + "![Variable_Editor](My%20Project/media/variable_input_editor.png)"
HelpString += vbCrLf + vbCrLf + "The Variable name is required. There are restrictions on the name. "
HelpString += "It cannot start with a number. It can only contain letters and numbers and the "
HelpString += "underscore '_' character."
HelpString += vbCrLf + vbCrLf + "If a variable on the list is not in the file, it can optionally be added automatically. "
HelpString += "Set the option on the **Configuration Tab -- General Page**. "
HelpString += vbCrLf + vbCrLf + "The number/formula is not required if only exposing an existing variable, "
HelpString += "otherwise it is. If a formula references a variable not in the file, the "
HelpString += "program will report an error."
HelpString += vbCrLf + vbCrLf + "If exposing a variable, the Expose name defaults to the variable name. "
HelpString += "You can optionally change it. The Expose name does not have restrictions like the variable name. "
HelpString += vbCrLf + vbCrLf + "The variables are processed in the order in the table. "
HelpString += "You can change the order by selecting a row and using the Up/Down buttons "
HelpString += "at the top of the form. Only one row can be moved at a time. "
HelpString += "The delete button, also at the top of the form, removes selected rows. "
HelpString += vbCrLf + vbCrLf + "You can copy the settings on the form to other tabs. "
HelpString += "Set the `Copy To` CheckBoxes as desired."
HelpString += vbCrLf + vbCrLf + "Note the textbox adjacent to the `Edit` button "
HelpString += "is a `Dictionary` representation of the table settings in `JSON` format. "
HelpString += "You can edit it if you want, but the form is probably easier to use. "
PopulateList(VariablesEdit,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresVariablesToEdit:=True)
Dim CopyOverallSizeToVariableTable As New L2A
TaskName = "CopyOverallSizeToVariableTable"
LabelText = "Copy overall size to variable table"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Copies the model size to the variable table. "
HelpString += "This is primarily intended for standard cross-section material "
HelpString += "(barstock, channel, etc.), but can be used for any purpose. "
HelpString += "Exposes the variables so they can be used in a callout, parts list, or the like. "
HelpString += vbCrLf + vbCrLf + "The size is determined using the built-in Solid Edge `RangeBox`. "
HelpString += "The range box is oriented along the XYZ axes. "
HelpString += "Misleading values will result for parts with an off axis orientation, such as a 3D tube. "
HelpString += vbCrLf + vbCrLf + "![Overall Size Options](My%20Project/media/overall_size_options.png)"
HelpString += vbCrLf + vbCrLf + "The size can be reported as `XYZ`, or `MinMidMax`, or both. "
HelpString += "`MinMidMax` is independent of the part's orientation in the file. "
HelpString += "Set your preference on the **Configuration Tab -- General Page**. "
HelpString += "Set the desired variable names there, too. "
HelpString += vbCrLf + vbCrLf + "Note that the values are non-associative copies. "
HelpString += "Any change to the model will require rerunning this command to update the variable table. "
HelpString += vbCrLf + vbCrLf + "The command reports sheet metal size in the formed state. "
HelpString += "For a flat pattern, instead of this using this command, "
HelpString += "you can use the variables from the flat pattern command -- "
HelpString += "`Flat_Pattern_Model_CutSizeX`, `Flat_Pattern_Model_CutSizeY`, and `Sheet Metal Gage`. "
PopulateList(CopyOverallSizeToVariableTable,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True, RequiresOverallSizeVariables:=True)
Dim RemoveFaceStyleOverrides As New L2A
TaskName = "RemoveFaceStyleOverrides"
LabelText = "Remove face style overrides"
AppliesToAssembly = True
AppliesToPart = False
AppliesToSheetmetal = False
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Face style overrides change a part's appearance in the assembly. "
HelpString += "This command causes the part to appear the same in the part file and the assembly."
PopulateList(RemoveFaceStyleOverrides,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim UpdateFaceAndViewStylesFromTemplate As New L2A
TaskName = "UpdateFaceAndViewStylesFromTemplate"
LabelText = "Update face and view styles from template"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Updates the file with face and view styles from a file you specify on the **Configuration Tab -- Templates Page**. "
HelpString += vbCrLf + vbCrLf + "Note, the view style must be a named style. Overrides are ignored. "
HelpString += "To create a named style from an override, open the template in Solid Edge, activate the `View Overrides` dialog, and click `Save As`."
HelpString += vbCrLf + vbCrLf + "![View Override Dialog](My%20Project/media/view_override_dialog.png)"
PopulateList(UpdateFaceAndViewStylesFromTemplate,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresTemplate:=True, RequiresSave:=True)
Dim HideConstructions As New L2A
TaskName = "HideConstructions"
LabelText = "Hide constructions"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Hides all non-model elements such as reference planes, PMI dimensions, etc."
PopulateList(HideConstructions,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim FitPictorialView As New L2A
TaskName = "FitPictorialView"
LabelText = "Fit pictorial view"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Maximizes the window, sets the view orientation, and does a fit. "
HelpString += "Select the desired orientation on the **Configuration Tab -- General Page**."
PopulateList(FitPictorialView,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True, RequiresPictorialView:=True, RequiresForegroundProcessing:=True)
Dim PartNumberDoesNotMatchFilename As New L2A
TaskName = "PartNumberDoesNotMatchFilename"
LabelText = "Part number does not match file name"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if the file name contains the part number. "
HelpString += "The part number is drawn from a property you specify on the **Configuration Tab -- General Page**. "
HelpString += "It only checks that the part number appears somewhere in the file name. "
HelpString += "If the part number is, say, `7481-12104` and the file name is `7481-12104 Motor Mount.par`, "
HelpString += "you will get a match. "
HelpString += vbCrLf + vbCrLf + "![part_number_matches_file_name](My%20Project/media/part_number_matches_file_name.png)"
PopulateList(PartNumberDoesNotMatchFilename,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresPartNumberFields:=True)
Dim MissingDrawing As New L2A
TaskName = "MissingDrawing"
LabelText = "Missing drawing"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Assumes drawing has the same name as the model, and is in the same directory"
PopulateList(MissingDrawing,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim BrokenLinks As New L2A
TaskName = "BrokenLinks"
LabelText = "Broken links"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks to see if any referenced external file is not found on disk."
PopulateList(BrokenLinks,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim LinksOutsideInputDirectory As New L2A
TaskName = "LinksOutsideInputDirectory"
LabelText = "Links outside input directory"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks to see if any assembly occurrence resides outside the top level directories specified on the **Home Tab**. "
PopulateList(LinksOutsideInputDirectory,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim CheckRelationships As New L2A
TaskName = "CheckRelationships"
LabelText = "Check relationships"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if any assembly occurrences have conflicting or otherwise broken relationships."
PopulateList(CheckRelationships,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim FailedRelationships As New L2A
TaskName = "FailedRelationships"
LabelText = "Failed relationships"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if any assembly occurrences have conflicting or otherwise broken relationships."
PopulateList(FailedRelationships,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim UnderconstrainedRelationships As New L2A
TaskName = "UnderconstrainedRelationships"
LabelText = "Underconstrained relationships"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if any assembly occurrences have missing relationships."
PopulateList(UnderconstrainedRelationships,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim CheckInterference As New L2A
TaskName = "CheckInterference"
LabelText = "Check interference"
AppliesToAssembly = True
AppliesToPart = False
AppliesToSheetmetal = False
AppliesToDraft = False
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Runs an interference check. All parts are checked against all others. "
HelpString += "This can take a long time on large assemblies, "
HelpString += "so there is a limit to the number of parts to check. "
HelpString += "Set it on the **Configuration Tab -- General Page**."
PopulateList(CheckInterference,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
'Dim ConfigurationsOutOfDate As New L2A
'HelpString = ""
'PopulateList(ConfigurationsOutOfDate,
' "Configurations out of date",
' "ConfigurationsOutOfDate",
' HelpString)
Dim RunExternalProgram As New L2A
TaskName = "RunExternalProgram"
LabelText = "Run external program"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Runs an `*.exe` or `*.vbs` or `*.ps1` file. Select the program with the `Browse` button. "
HelpString += "It is located on the **Task Tab** below the task list. "
HelpString += vbCrLf + vbCrLf + "If you are writing your own program, be aware several interoperability rules apply. "
HelpString += "See [<ins>**HousekeeperExternalPrograms**</ins>](https://github.com/rmcanany/HousekeeperExternalPrograms) for details and examples. "
PopulateList(RunExternalProgram,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresExternalProgram:=True)
Dim InteractiveEdit As New L2A
TaskName = "InteractiveEdit"
LabelText = "Interactive edit"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Brings up files one at a time for manual processing. "
HelpString += "A dialog box lets you tell Housekeeper when you are done. "
HelpString += vbCrLf + vbCrLf + "Some rules for interactive editing apply. "
HelpString += "It is important to leave Solid Edge in the state you found it when the file was opened. "
HelpString += "For example, if you open another file, such as a drawing, you need to close it. "
HelpString += "If you add or modify a feature, you need to click Finish. "
HelpString += vbCrLf + vbCrLf + "Also, do not Close the file or do a Save As on it. "
HelpString += "Housekeeper maintains a `reference` to the file. "
HelpString += "Those two commands cause the reference to be lost, resulting in an exception. "
PopulateList(InteractiveEdit,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresForegroundProcessing:=True)
Dim SaveAs As New L2A
TaskName = "SaveAs"
LabelText = "Save As"
AppliesToAssembly = True
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = True
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Exports the file to either a non-Solid Edge format, or the same format in a different directory. "
HelpString += vbCrLf + vbCrLf + "Select the file type using the `Save As` combobox. "
HelpString += "Select the directory using the `Browse` button, "
HelpString += "or check the `Original Directory` checkbox. "
HelpString += "These controls are on the **Task Tab** below the task list. "
HelpString += vbCrLf + vbCrLf + "Images can be saved with the aspect ratio of the model, rather than the window. "
HelpString += "The option is called `Save as image -- crop to model size`. "
HelpString += "It is located on the **Configuration Tab -- General Page**. "
HelpString += vbCrLf + vbCrLf + "You can optionally create subdirectories using a formula similar to the Property Text Callout. "
HelpString += "For example `Material %{System.Material} Thickness %{Custom.Material Thickness}`. "
HelpString += vbCrLf + vbCrLf + "A `Property set`, either `System` or `Custom`, is required. "
HelpString += "For more information, see the **Property Filter** section above. "
HelpString += vbCrLf + vbCrLf + "It is possible that a property contains a character that cannot be used in a file name. "
HelpString += "If that happens, a replacement is read from filename_charmap.txt in the Preferences directory in the Housekeeper root folder. "
HelpString += "You can/should edit it to change the replacement characters to your preference. "
HelpString += "The file is created the first time you run Housekeeper. For details, see the header comments in that file. "
PopulateList(SaveAs,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSaveAsOutputDirectory:=True,
RequiresForegroundProcessing:=True)
Dim UpdateMaterialFromMaterialTable As New L2A
TaskName = "UpdateMaterialFromMaterialTable"
LabelText = "Update material from material table"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks to see if the part's material name and properties match any material "
HelpString += "in a file you specify on the **Configuration Tab -- Templates Page**. "
HelpString += vbCrLf + vbCrLf + "If the names match, "
HelpString += "but their properties (e.g., face style) do not, the material is updated. "
HelpString += "If the names do not match, or no material is assigned, it is reported in the log file."
HelpString += vbCrLf + vbCrLf + "You can optionally remove any face style overrides. "
HelpString += "Set the option on the **Configuration Tab -- General Page**. "
PopulateList(UpdateMaterialFromMaterialTable,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresMaterialTable:=True, RequiresSave:=True)
Dim UpdateInsertPartCopies As New L2A
TaskName = "UpdateInsertPartCopies"
LabelText = "Update part copies"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = True
HelpURL = GetHelpURL(LabelText)
HelpString = "In conjuction with `Assembly Activate and update all`, "
HelpString += "used mainly to eliminate the gray corners on assembly drawings. "
HelpString += "You can optionally update the parent files recursively. "
HelpString += "That option is on the **Configuration Tab -- General Page**."
PopulateList(UpdateInsertPartCopies,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim FailedOrWarnedFeatures As New L2A
TaskName = "FailedOrWarnedFeatures"
LabelText = "Failed or warned features"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if any features of the model are in the Failed or Warned status."
PopulateList(FailedOrWarnedFeatures,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim SuppressedOrRolledBackFeatures As New L2A
TaskName = "SuppressedOrRolledBackFeatures"
LabelText = "Suppressed or rolled back features"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if any features of the model are in the Suppressed or Rolledback status."
PopulateList(SuppressedOrRolledBackFeatures,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim UnderconstrainedProfiles As New L2A
TaskName = "UnderconstrainedProfiles"
LabelText = "Underconstrained profiles"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks if any profiles are not fully constrained."
PopulateList(UnderconstrainedProfiles,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim InsertPartCopiesOutOfDate As New L2A
TaskName = "InsertPartCopiesOutOfDate"
LabelText = "Insert part copies out of date"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "If the file has any insert part copies, checks if they are up to date."
PopulateList(InsertPartCopiesOutOfDate,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim MaterialNotInMaterialTable As New L2A
TaskName = "MaterialNotInMaterialTable"
LabelText = "Material not in material table"
AppliesToAssembly = False
AppliesToPart = True
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks the file's material against the material table. "
HelpString += "The material table is chosen on the **Configuration Tab -- Templates Page**. "
PopulateList(MaterialNotInMaterialTable,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresMaterialTable:=True)
Dim UpdateDesignForCost As New L2A
TaskName = "UpdateDesignForCost"
LabelText = "Update design for cost"
AppliesToAssembly = False
AppliesToPart = False
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Updates DesignForCost and saves the document."
HelpString += vbCrLf + vbCrLf + "An annoyance of this command is that it opens the "
HelpString += "DesignForCost Edgebar pane, but is not able to close it. "
HelpString += "The user must manually close the pane in an interactive Sheetmetal session. "
HelpString += "The state of the pane is system-wide, not per-document, "
HelpString += "so closing it is a one-time action. "
PopulateList(UpdateDesignForCost,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim FlatPatternMissingOrOutOfDate As New L2A
TaskName = "FlatPatternMissingOrOutOfDate"
LabelText = "Flat pattern missing or out of date"
AppliesToAssembly = False
AppliesToPart = False
AppliesToSheetmetal = True
AppliesToDraft = False
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks for the existence of a flat pattern. "
HelpString += "If one is found, checks if it is up to date. "
PopulateList(FlatPatternMissingOrOutOfDate,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL)
Dim UpdateDrawingViews As New L2A
TaskName = "UpdateDrawingViews"
LabelText = "Update drawing views"
AppliesToAssembly = False
AppliesToPart = False
AppliesToSheetmetal = False
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Checks drawing views one by one, and updates them if needed."
PopulateList(UpdateDrawingViews,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresSave:=True)
Dim UpdateStylesFromTemplate As New L2A
TaskName = "UpdateStylesFromTemplate"
LabelText = "Update styles from template"
AppliesToAssembly = False
AppliesToPart = False
AppliesToSheetmetal = False
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Updates styles and background sheets from a template you specify on the **Configuration Tab -- Templates Page**. "
HelpString += vbCrLf + vbCrLf
HelpString += "These styles are processed: DimensionStyles, DrawingViewStyles, LinearStyles, TableStyles, TextCharStyles, TextStyles. "
HelpString += "These are not: FillStyles, HatchPatternStyles, SmartFrame2dStyles. "
HelpString += "The latter group encountered errors with the current implementation. The errors were not thoroughly investigated. "
HelpString += "If you need one or more of those styles updated, please ask on the Forum. "
PopulateList(UpdateStylesFromTemplate,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,
HasOptions,
HelpURL:=HelpURL,
RequiresTemplate:=True, RequiresSave:=True)
Dim UpdateDrawingBorderFromTemplate As New L2A
TaskName = "UpdateDrawingBorderFromTemplate"
LabelText = "Update drawing border from template"
AppliesToAssembly = False
AppliesToPart = False
AppliesToSheetmetal = False
AppliesToDraft = True
HasOptions = False
HelpURL = GetHelpURL(LabelText)
HelpString = "Replaces the background border with that of the Draft template specified on "
HelpString += "the **Configuration Tab -- Templates Page**."
HelpString += vbCrLf + vbCrLf + "In contrast to `UpdateStylesFromTemplate`, this command only replaces the border. "
HelpString += "It does not attempt to update styles or anything else."
PopulateList(UpdateDrawingBorderFromTemplate,
TaskName,
LabelText,
HelpString,
AppliesToAssembly,
AppliesToPart,
AppliesToSheetmetal,
AppliesToDraft,