I've put these together to do it, just in case you're interested.
They're intended to be used in a str as
prm foo = dspacing_tetragonal(1,0,3);
.
macro dspacing_cubic(h, k, l)
{
(Sqrt(1/((h^2 + k^2 + l^2) / Get(a)^2)))
}
macro dspacing_tetragonal(h, k, l)
{
(Sqrt(1/(((h^2 + k^2)/ Get(a)^2) + l^2/Get(c)^2)))
}
macro dspacing_hexagonal(h, k, l)
{
(Sqrt(1/((4/3)*(h^2 + h*k + k^2)/Get(a)^2 + (l/Get(c))^2)))
}
macro dspacing_rhombohedral(h, k, l)
{
(Sqrt(1/((((h^2 + k^2 + l^2) Sin(Get(al) Deg)^2)+
(2 (h k + k l + h l) (Cos(Get(al) Deg)^2 - Cos(Get(al) Deg))))
/
(Get(al)^2 (1 - 3 Cos(Get(al) Deg)^2 + 2 Cos(Get(al) Deg)^3)))))
}
macro dspacing_orthorhombic(h, k, l)
{
(Sqrt(1/((h/Get(a))^2 + (k/Get(b))^2 + (l/Get(c))^2)))
}
macro dspacing_monoclinic(h, k, l)
{
(Sqrt(1/((1/Sin(Get(be) Deg)^2)
((h/Get(a))^2 +
(k Sin(Get(be) Deg) / Get(b))^2 +
(l/Get(c))^2 -
((2 h l Cos(Get(be) Deg)) / (Get(a) Get(c)))))))
}
macro dspacing_triclinic(h, k, l)
{
(Sqrt(1/(((h^2 (Get(b) Get(c) Sin(Get(al) Deg))^2) +
(k^2 (Get(a) Get(c) Sin(Get(be) Deg))^2) +
(l^2 (Get(a) Get(b) Sin(Get(ga) Deg))^2) +
((2 h k) (Get(a) Get(b) Get(c)^2 (Cos(Get(al) Deg) Cos(Get(be) Deg) - Cos(Get(ga) Deg)))) +
((2 k l) (Get(a)^2 Get(b) Get(c) (Cos(Get(be) Deg) Cos(Get(ga) Deg) - Cos(Get(al) Deg)))) +
((2 h l) (Get(a) Get(b)^2 Get(c) (Cos(Get(ga) Deg) Cos(Get(al) Deg) - Cos(Get(be) Deg)))))
/
(((Get(a) Get(b) Get(c))^2) (1 - Cos(Get(al) Deg)^2 - Cos(Get(be) Deg)^2 - Cos(Get(ga) Deg)^2 + 2 Cos(Get(al) Deg) Cos(Get(be) Deg) Cos(Get(ga) Deg))))))
}