There are functions that work with string-valued right-hand sides:
Snap.NX.Expression.RightHandSide
NXOpen.Expression.RightHandSide
If you want to work with numbers, instead, there are functions like:
Snap.NX.ExpressionNumber.Value
NXOpen.Expression.Value
NXOpen.Expression.IntegerValue