Each rim is slightly to very different in construction, so spoke length is different for each rim, even if you use the same hub.
The same is true of which way you lace the wheel--a different lacing pattern means longer or shorter spokes to achieve that.
It's not a riddle, it's the way spoked wheels work.
This is why there are spoke calculators out there, that often have instructions on measuring your rim and hub to get the ERD and spoke flange dimensions necessary, along with any offsets for wheels that need this for whatever reason. Then input those numbers along with the lacing pattern you will use to get the right spoke length for your wheel build.
If you prefer to just use what someone else's different rim used, with perhaps a different lacing pattern, and potentially end up with spokes too long or short to use on your wheel, you can certainly look around to see what people have posted for such wheel builds, or wait for them to post them up here in your thread. But you may just be wasting money on the spokes you get from those numbers.
Let's say that someone used radial lacing on their wheel, with a rim that does not have directional nipple holes. But your rim does have directional nipple holes, and you use a 1x lacing. Their spoke length will be far too short for you to use. The same is true in reverse. That's just one example of a difference that could leave you with unusable spoke measurements.
Your call, though, so I'll leave you to it.