Here's your code that will work now
int numRows = Table("GlobalTable1").numRows;
int x_Col = 2;
int y_Col = 3;
int z_Col = 4;
int Name_COL = 1;
treenode prevnode = NULL;
for (int i=1; i<=Table("GlobalTable1").numRows; i++)
{
int xLoc=Table("GlobalTable1").cell(i,x_Col).value;
int yLoc=Table("GlobalTable1").cell(i,y_Col).value;
int zLoc=Table("GlobalTable1").cell(i,z_Col).value;
string newName = Table("GlobalTable1").cell(i,Name_COL).value;
treenode nnode = createinstance(library.find("?NetworkNode"),model());
nnode.as(Object).location.x=xLoc;
nnode.as(Object).location.y=yLoc;
nnode.as(Object).location.z=zLoc;
nnode.name=newName;
if (objectexists(prevnode))
contextdragconnection(prevnode, nnode, "A");
prevnode = nnode;
}
If you want to access functions or variable inherent to a specific class, you should use .as(Class), rather then put the class in front unless you are defining a new object. The code above also limits the iterations to the length of your rows in the global table now.