I think I have it.
UnitValueDefaultView unitIBA=(UnitValueDefaultView)attValue;
double value = unitIBA.getValue();
UnitDefView unit = unitIBA.getUnitDefinition();
log.debug("Value is " + value);
log.debug("Unit:"+unit.getName()+"|"+unit.getDescription());
log.debug("Unit Def Display String|" + unit.getDefaultDisplayUnitString("m"));
try {
double d=unitIBA.toUnit().convert("cm");
log.debug("Value is now " + d + " cm.");
}
catch (IncompatibleUnitsException e) {
log.debug(e.getMessage());
}
catch (UnitFormatException f) {}
log.debug("Now IBA is " + iba + "|" + unitIBA.getLocalizedDisplayString());
Resulting log:
Value is 0.05
Unit:WIDTH|CISPart Width
Unit Def Display String|m
Value is now 5.0 cm.
Now IBA is WIDTH|5E-2 m
So, you need to catch the exceptions I've listed above. The convert method takes a valid units string and converts the value to the new units. It does not change the underlying value of the IBA which is stored as the base unit. In this case, it is meters. Now, I just need to play with precision and significant figures. Just as a note, I entered this IBA value as centimeters when I created it as a Part attribute.