I recoreded a macro to change the ordinate dimension colors (nothing related to layers)
I am just trying to learn how the code works
Can someone please guide me and show me how this can be done?
Here is the recorded macro
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
Part.ViewZoomtofit2
boolstatus = Part.ActivateSheet("Default")
boolstatus = Part.ActivateView("Drawing View1")
boolstatus = Part.Extension.SelectByID2("D1@Sketch3@bottom-plate.SLDDRW", "DIMENSION", 0.406098444121916, 0.314275785195936, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D2@Sketch3@bottom-plate.SLDDRW", "DIMENSION", 0.416251071117562, 0.354886293178519, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D3@Sketch3@bottom-plate.SLDDRW", "DIMENSION", 0.412866862119013, 0.425277840348331, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D4@Sketch3@bottom-plate.SLDDRW", "DIMENSION", 0.415574229317852, 0.464534664731495, 0, True, 0, Nothing, 0)
boolstatus = Part.ActivateView("Drawing View2")
boolstatus = Part.Extension.SelectByID2("D1@Sketch12@bottom-plate.SLDDRW", "DIMENSION", 0.423019489114659, 0.187706368650218, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D2@Sketch12@bottom-plate.SLDDRW", "DIMENSION", 0.434525799709724, 0.208011622641509, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D3@Sketch12@bottom-plate.SLDDRW", "DIMENSION", 0.431141590711176, 0.226963193033382, 0, True, 0, Nothing, 0)
boolstatus = Part.ActivateView("Drawing View3")
boolstatus = Part.Extension.SelectByID2("D1@Sketch14@bottom-plate.SLDDRW", "DIMENSION", 0.83860035413643, 0.313598943396226, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D2@Sketch14@bottom-plate.SLDDRW", "DIMENSION", 0.83860035413643, 0.356916818577649, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D3@Sketch14@bottom-plate.SLDDRW", "DIMENSION", 0.840630879535559, 0.423247314949202, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("D4@Sketch14@bottom-plate.SLDDRW", "DIMENSION", 0.841307721335268, 0.466565190130624, 0, True, 0, Nothing, 0)
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.SetLineColor 8388863
Part.ClearSelection2 True
End Sub
Will it be possible to have the option to select the complete horizontal ordinate dimensions at a time, than by sketch IDs (instead of 13 in this case) and one Part.SetLineColor?
Thanks,
JOHN
SolidworksApi macros