[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: obtaining node co-ordinates
>There currently isn't a built-in way of doing that, but it would be
>easy to modify the implementation of the selectnode() command to
>return the coordinates of the selected node. At the end of the
>lua_selectnode implemenation in luadoc.cpp, just replace:
>return 0;
>with
>lua_pushnumber(L,thisDoc->nodelist[node].x);
>lua_pushnumber(L,thisDoc->nodelist[node].y);
>return 2;
>
>and recompile.
just compiled it this morning, works fine. To test, I drew a random
node in BELAdraw and openend the LUA console and entered
golf,golf2 = selectnode(0,0)
print(golf, golf2)
It successfully returned to node co-ordinates :-)
thanks again David
James