The distance from the camera to the object is very easy to determine. Simply get back far enough to see the object you want to measure (or the part of the object you want to measure if you are measuring the object in sections). As a rule of thumb, you will need to get the same distance back from the object as the size of the object. For example, you will need to get about ten feet back to measure a ten foot object. See Field of View for more details.
If you haven’t done so already, read question 1 above about factors affecting accuracy, especially the fourth factor regarding geometry. Of course, getting good geometry isn’t the only consideration when considering where to locate the camera for a good measurement. You must also locate the camera so every target is ultimately seen in at least two (preferably four) photographs with strong geometry. On objects with lots of blockage and or complex surfaces, figuring out where to locate the cameras to get a good measurement can be a challenge.