A dashed line with a tiny dash and a large gap using a zero thickness pen is one option as you have discovered.
Another is that any line using a white pen will not print (again thick or thin pen depending on whether you are trying to hide other elements or not).
Use the display order options to bring it forward in front of other elements to hide them if necessary or send it backwards if you don't want it to interfere with other elements.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11