Finding a rim to swap in on a damaged wheel
Yes, you basically just need another rim of the same ERD. You actually have some wiggle room as long as you're tracking what the thread engagement was like on the first time and know which way to wiggle it. (Don't use aluminum nipples if you're going to have less than optimal engagement.) Also you can switch nipple lengths to have yet more options.
If it was an offset/asymmetrical rim, in theory that could throw it off and leave you with some spokes too long or too short, but it usually wouldn't make enough difference.
Looking way back in time, the &quot;handedness&quot; (offset orientation of the spoke holes adjacent to the valve) of rims didn't used to be universal like it is now, so you'd have to look at that on a vintage wheel you were doing this to.
Use new nipples. Rounding one off because of trying to save $2 wouldn't be good.
You can check how satisfactory the thread engagement is of the existing spokes, measure them, measure the hub, and then use all that information to calculate the ERD of your rim (or its ideal replacement) in reverse. SpoCalc makes it pretty easy to do that.