Fanuc offers the ability to perform length/width inspection with the iRVision Inspection Application. The code isn't much different than other vision processes but you will need the inspection option to perform measurements.
I have yet to use iRVision to perform measurement and Cognex products might be better suited for the task.