Preview | SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
RLRon Lau20/08/2024
This is supposed to set each part in an assembly to a random color, but it's all one big kerfuffle.
Dim swApp As Object Dim swModel As ModelDoc2 Dim swAssembly As AssemblyDoc Dim swComponent As Component2 Dim swComponents As Variant Dim i As Integer Sub main() Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swAssembly = swModel If swModel.GetType <> swDocASSEMBLY Then MsgBox "Please