LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lpav.SetPosition - Set the object position in the view

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax

result = lpav.SetPosition(x,y);
result = lpav.SetPosition(x,y,x1,y1);

Description

Set the position of the default object to x,y coordinates. If x1 y1 are specified the object size is modified accordingly.

Parameters

X The X position of the object, the number of pixel from the right border of the Active View display area
Y The Y position of the object, the number of pixel from the top border the Active View display area
X1 The width of the object in pixel
Y1 The high of the object in pixel

Return Values

result = 1 or return nil if error

Example

lp.Trace("start");
dofile(lp.GetPath().."/config/script/loriotinit.lua");
lp_value = 0;
lp_buffer ="error";
lpav.Load(lp.GetPath().."/config/active-view/sample/cisco3500.cmp");

for i=1,5 do
co=lpav.SelectFirst();
while co~=nil do
if lpav.GetInformation("a") then
if a.objtype~=LPAV_OBJ_CONNECTOR then
x,y,x1,y1=lpav.GetPosition();
if x>1000 then x=10 end
if y>1000 then y=10 end
lpav.SetPosition(x+100,y+100,x1,y1);
end
end
co=lpav.SelectNext();
end
lpav.RefreshMap();
end

lpav.RefreshMap();
lp.Trace("fin");


 



www.loriotpro.com