Hi Nicolo,
If you want control over the refractive index and Abbe number, I suggest you use a Solve. There are two valid Solve types you can use. Either you can use a Model glass (Model Solve Type), which exposes the Index Nd, Abbe Vd, and dPgF. Basically, you define your material as a Model glass and you change it whenever you need to. Or you can use an Offset solve. In this case, you can give your surface a material, say N-BK7, and the Offset solve exposes a Nd Offset and a Vd Offset. The resulting material will be N-BK7 plus the offset (I hope it makes sense).
For tolerancing, I would use the Offset Solve, and here’s a small example:
MySurface = TheSystem.LDE.GetSurfaceAt(1)
MyMaterialCell = MySurface.MaterialCell
MyOffsetSolve = MyMaterialCell.CreateSolveType(ZOSAPI.Editors.SolveType.MaterialOffset)
MyOffsetSolve.NdOffset = 0.001
MyOffsetSolve.VdOffset = 0.05
MyMaterialCell.SetSolveData(MyOffsetSolve)
Hopefully the code is self-explanatory, let me know otherwise. Whatever the material of Surface 1 is, this code will offset the refractive index by 0.001 and the Abbe number by 0.05.
Take care,
David