how can i design a grid

Hi! everyone

i am indeed to develop a application which is used to import some CAD files. i need to display grids in the opengl viewport. please send me some example codes. 

thank you

I had really bad experience importing CAD data into OpenGL. CAD data consist of natively lines and arcs, but OpenGL is interested in polygon to render faces. Holes and overlapped surfaces are everywhere after conversion. I spent most of time to fix this problems manually during the project.

Anyway, drawing grid line is very simple in OpenGL, for example:

    glVertex3f(0,0,0); // a pair of vertice (2 end points of line)

It will draw a line between (0,0,0) and (1,1,0). Since the grid is static, it is a good idea to put it into a display list.