I use Labcenter Proteus Circuit simulation - you create circuit design, then apply current and see simulation in action - for example leds are blinking, or motor is rotating. If there is microcontroller - say AVR, you just load compiled hex file for it and see simulation live - again, if it was programmed to blink led, and there is one on pin, it will blink, or you can simulate button pressing and see what happens, etc.
Now, I know SolidWorks have SolidWorks Electric, SolidWorks Simulation, SolidWorks CircuitWorks (are those all?), is there any way to have such functionality in it? I mean, if I have added motor to project, then created circuit with avr microcontroller in SolidWorks electrical, is there a way to somehow combine those two, set .hex file for avr and run simulation to see how motor moves? Or Any alternative, how do engineers do such things?