Works like a charm, thank you, problem solved! But I think it should be ultimately divided by line thickness instead of multiplied - at least that's how I got these calculations right. If anyone wondering:
dxDrawMaterialSectionLine3D(x, y, z, x, y, liftZ + liftHeight, 0, 0, 16, ((64 * ((z - liftZ) + liftHeight)) / (64 / 16)) / 0.1, misc.chainTexture, 0.1)