SW 2022. I’m trying to change the color of a sketch with a particular name “Mid1” in multiple part templates. I want to change to color of this particular named sketch in all these files from Green (0,255,0) to Blue (0,0,255). But I’m having trouble Finding a VBA command that will do the actual color assignment.
Anyone have any ideas what I should be looking for. Thanks!
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim color As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
color = RGB(0, 0, 255) ' Blue
boolstatus = Part.Extension.SelectByID2("Mid1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
If boolstatus Then Part.SetLineColor color
End Sub