I confirm the opinion of @charleslr (whom I salute) Solidworks is a disaster except for very simple movements.
When I say very simple, it's two or three axes max and again.
There are two functions that allow you to achieve a correct result:
the first is motion which is included in the Solidworks premium version and in the PRO version. For a robot, Motion must only work with constraint control, which is very difficult to use for complex movements.
For a FANUC 5 axes I was forced to make a mix between a head control with 3D splines more or less parallel (as if you had rails the head being the carriage) and constraints for the wrist. As it was for a simple movement of a frame I did this to sell to the customer. But I promised myself that I would never do that again.
The other solution is a shit that appeared in 2017 or 2018 and is called "constraint driver" I say shit because you can't chain more than 10 sequences. Plus, it's crappy to use because it's not a standalone function like Motion, but it's a feature barely adapted to do ultra basic stuff. At best you can do pick-and-place but you will never drive a welding robot for a fitting workshop for example
So the "trèscherware" solutions indicated by @charleslr don't seem to be the only ones to look at.
Kind regards
PS: on the other hand, a colleague who works at FANUC uses SW simulation to check the calculations that the frames and cells on which the robots are attached because since it works almost all the time in cantilevers it is prudent to make simus on the fixing frames
As @zozo_mp says, "Constraint Driver" is not suitable for complex movements because the constraints taken into account are reduced. But if the movements are simple like a small special machine, you can have an interesting result for a small video (see video https://www.youtube.com/watch?v=7NgqkcigBI4 as an example).
With Motion, you must use the Sequential Motion module. I've used it with some pretty simple machines; It requires a certain investment in the software and the result is correct.
But from there to using it with a robot, it must be a good mastery.