Yes, just measure the fall of the main halyard and add the distance to the mast foot. This will give you ther height for all practical purposes, but for real accuarcy you will need the distance between the the top of the main sheave and the top of the mast - small inches!
A solution which will provide an approximate height is to haul a tape measure end up the mast by using the main halyard and thus obtaining the height from deck to the main halyard sheave, add to this your guestimate of the distance from the main halyard sheave to the top of the mast.
If you really want to know accurately you could moor the boat at the end of a pontoon and use a sextant to measure the angle from top to bottom of mast from an accurately measured distance away, then apply a little geometry. But as a surveyor I think hoisting a tape up the mast on a very calm day would be easier and just as accurate. If you want air draft take the tape to the waterline, it will give a slightly higher reading, but unless you have a very wide beam should not be significant. Remember to add on antenna etc if looking for under bridge clearance.
Sit on the pontoon, make sure your sextant is horizontal and then take a sight of the masthead. reverse the boat and do the same from the stern. go home and ask your wife if she can remember her schoolgirl trig and when she says no, toddle off down to the library and spend a pleasant half hour boning up on the subject. then apply the required foirmulae to the data and your knowledge of the boats length (remember this isnt a marina booking so use the real length) and bobs your relative.
an alternative is to shin up the mast with a stopwatch and an apple and time the lag between letting go of the apple and your crew saying "ouch". apply newtonian mechanics using g = 32 ft/sec/sec
or on the other hand you could just ask someone else with a similar boat
Couple of suggestions above to use boat spec or ask owner of similar boat. This is fine as long as your boat was built to the standard spec, but I have owned two production boats that had none standard masts - one smaller and heavier, the other slightly taller and heavier.
How accurate you need to be depends on what and why you need to know. I have measure for new sails and replacing rigging using a fibre tape from deck level on a calm day.