Stay off the machines at the gym. Instead do leg lifts (abduction, adduction, flexion and extension) with cuff weights around the ankle if the cast fails to provide enough weight.
10 reps of each direction for multiple sets daily.
For cardio, do UE ergometer (Upper arm cycling machine).
Tom Plamondon PA-C, PT