Hello,
I am trying to set the geoLocation on some containers using nxshell.
I am not able to find how to set the geolocation neither how to update the geolocation of my node
cd = session.findObjectById(123)
geo = cd.geolocation
print geo
This works but now ...
geo.setLatitude(11.1) or anything in this way does not work.
And then I can not find a cd.setGeoLocation()
And neither cd.geolocation = geo works as it is a read-only attribute.
Regards.
Hi,
Geolocation is an immutable object, so you have to create new object when you need different location. NetObj and derived classes are also immutable, so you have to use NXCObjectModificationData class and session.modifyObject method. Working example for getting and setting geo location for node:
from org.netxms.base import GeoLocation
node = session.findObjectByName("netxms")
print node.getGeolocation()
md = NXCObjectModificationData(node.getObjectId())
md.setGeolocation(GeoLocation(11.0, 22.0))
session.modifyObject(md)
Best regards,
Victor