The rim is likely ok if true, not buckled or cracked, look at each eyelet and check for any hair line cracks. If it looks ok then opt for new spokes to rebuild the rim with.
Who is going to build the wheel up ?
Usually one can remove good spokes and measure them carefully from the centre of the J bend to the tip to get the length in MM , though I also prefer to use a spoke calc to see that they are right .
For a spoke calc the two important measurements needed are the ERD and hub spoke hole diameter.
One can measure ERD carefully int two or three places to make sure one gets a similar measurement once the motor is out , measure the rim inside side to side from opposing holes and then add 5mm allowing for the rims material thickness.
Or one can simply apply a wrap of tape a round apair of spokes near the J bend , insert the other end in the rim and add a nipple so it is flush with end and pull the two spokes tight so the nipple sits correctly .
Then add three measurements together for the ERD, two measuerments are the spoke length form the nipple end to the end of each tape line on the spoke and the third measurement is the gap between end of the tape on the spokes when pulled together.
The rIm hole diameter should be fairly easy to measure using a compass or caliper tool in an opposing hole to get the spread width.
If the rim ERD measures differently form a few opposing holes then it may be out of shape and slightly eliptical so would be best to replace.