This is one of the questions that I get a lot - Most would say that the answer is no, since there´s no build-in "Visible" parameter for Voids, as the case is for solids.
But if you follow a few simple steps, the answer is actually YES - It CAN be done :-)
1. Create two extra ref. planes to control the void height (or depth, or whatever you´re after)
2. Lock one of those to a given distance from the solid (in this case 500 mm´s)
3. Dimension and label the distance between those two ref. planes (Length parameter names "Void Height"
4 Create the Void, and lock the top and bottom to the two ref. planes.
5. Create a new "Yes/No" parameter named "Void Visible" and assign this formula > if(Void Visible, Solid Height + 500 mm, 500 mm)