The following OriginC function should do what you want ...
#include <GetNBox.h>
void SmoothWksCols()
{
Worksheet Wks(Project.ActiveLayer());
if(Wks.IsValid()==true)
{
int ptsLeft=3;
int ptsRight=3;
int iPolyOrder=2;
int imethod;
GETN_TREE(myTree)
GETN_LIST(Method,"Smoothing Method",1,"Adjacent Averaging|Savitzky-Golay|Median Filter")
GETN_NUM(LeftPts, "Points to Left", ptsLeft)
GETN_NUM(RightPts,"Points to Right",ptsRight)
GETN_NUM(PolyOrder,"Ploynomial Order",iPolyOrder)
if(GetNBox(myTree, "Enter Smoothing Parameters"))
{
if (myTree.LeftPts.dVal>0)
{
ptsLeft=myTree.LeftPts.dVal;
}
if (myTree.RightPts.dVal>0)
{
ptsRight=myTree.RightPts.dVal;
}
if (myTree.PolyOrder.dVal>0)
{
iPolyOrder=myTree.PolyOrder.dVal;
}
imethod=myTree.Method.dVal;
}
foreach (Column wCol in Wks.Columns)
{
Dataset dS;
if(dS.Attach(wCol)==false) return;
if(smooth(dS,imethod,ptsLeft,ptsRight,iPolyOrder )==false) return;
}
}
}