The reason why there are dashed lines on the top is that you do not draw the polygon on the top. As for the alphabetic numbering, `foreach` understands alphabetical sequences. (Why LaTeX decided to "hide" the `\@Alph` command from the general public I don't know, but we can use it invoking `\makeatletter` and `\makeatother`.) Building up the list of vertices is straightforward with the `/.list` key handler:
```
\edef\mycorners{{(A')}}		
\tikzset{add corner/.code={\edef\mycorners{\mycorners,{(#1')}}},
	add corner/.list={B,...,\myLetter}}		
```
All these things combined give
```
\documentclass[border=2mm,tikz]{standalone} 
\usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round]
  \begin{scope}[3d/install view={phi=110,theta=70},
		declare function={R=3;% radius of the base 
			H=5;% height of S
		% height of the intersecting plane
		},
		Dot/.style 2 args={circle,fill,inner sep=1.2pt,label=#1:{#2}},
		dot/.style={Dot={below}{#1}},dot'/.style={Dot={above}{#1}}]
	\pgfmathtruncatemacro{\Ncorners}{7}	
	\makeatletter
	\edef\myLetter{\@Alph{\Ncorners}}
	\makeatother	
	\path 
		(0,0,0) coordinate (O) 	
		(0,0,H) coordinate (S) 
		(0,0,H/2) coordinate (CC) 		
		foreach \X [count=\Y] in {A,...,\myLetter}
		{({R*cos(\Y*360/\Ncorners)},{R*sin(\Y*360/\Ncorners)},0) 
			coordinate (\X)
		({R*cos(\Y*360/\Ncorners)},{R*sin(\Y*360/\Ncorners)},H) 
		coordinate (\X')
		};
	\path foreach \X in {A,...,\myLetter}{
	(\X) node[dot={$\X$}]{} (\X') node[dot'={$\X'$}]{}};
	\edef\mycorners{{(A')}}		
	\tikzset{add corner/.code={\edef\mycorners{\mycorners,{(#1')}}},
		add corner/.list={B,...,\myLetter}}		
	\begin{scope}[3d/polyhedron/.cd,O={(CC)},fore/.append style={fill=none},
		back/.append style={3d/hidden},
		fore/.append style={3d/visible,fill=none},
		edges have complete dashes]
		\foreach \X [remember=\X as \LastX (initially \myLetter)] 
		in {A,...,\myLetter} 
		{\tikzset{3d/polyhedron/draw face with
		corners/.expanded={{(\LastX)},{(\LastX')},{(\X')},(\X)}}}
		\tikzset{3d/polyhedron/draw face with corners/.expanded={\mycorners}}
    \end{scope} 		
  \end{scope}
\end{tikzpicture}
\end{document}  
```

If you want to wrap this in a loop, a few precautions are necessary.
```
\documentclass[border=2mm,tikz]{standalone} 
\usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools
\makeatletter
\tikzset{Dot/.style 2 args={circle,fill,inner sep=1.2pt,label=#1:{#2}},
		dot/.style={Dot={below}{#1}},dot'/.style={Dot={above}{#1}},
		add corner/.code={\edef\mycorners{\mycorners,{(#1')}}},
		Alpha/.code 2 args={\edef#1{\@Alph{#2}}}}
\makeatother	
\begin{document}
\foreach \Ncorners in {3,...,12}
{\begin{tikzpicture}[line cap=round,line join=round,same bounding box=A]
  \begin{scope}[3d/install view={phi=110,theta=70},
		declare function={R=3;% radius of the base 
			H=5;% height of S
		% height of the intersecting plane
		},Alpha={\myLetter}{\Ncorners},		
		]
	\path 
		(0,0,0) coordinate (O) 	
		(0,0,H) coordinate (S) 
		(0,0,H/2) coordinate (CC) 		
		foreach \X [count=\Y] in {A,...,\myLetter}
		{({R*cos(\Y*360/\Ncorners)},{R*sin(\Y*360/\Ncorners)},0) 
			coordinate (\X)
		({R*cos(\Y*360/\Ncorners)},{R*sin(\Y*360/\Ncorners)},H) 
		coordinate (\X')};
	\path foreach \X in {A,...,\myLetter}{
	(\X) node[dot={$\X$}]{} (\X') node[dot'={$\X'$}]{}};
	\edef\mycorners{{(A')}}		
	\tikzset{add corner/.list={B,...,\myLetter}}		
	\begin{scope}[3d/polyhedron/.cd,O={(CC)},fore/.append style={fill=none},
		back/.append style={3d/hidden},
		fore/.append style={3d/visible,fill=none},
		edges have complete dashes]
		\foreach \X [remember=\X as \LastX (initially \myLetter)] 
		in {A,...,\myLetter} 
		{\tikzset{3d/polyhedron/draw face with
		corners/.expanded={{(\LastX)},{(\LastX')},{(\X')},(\X)}}}
		\tikzset{3d/polyhedron/draw face with corners/.expanded={\mycorners}}
    \end{scope} 		
  \end{scope}
\end{tikzpicture}}
\end{document} 
```
