NXShell change geoLocation
-
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 nodecd = session.findObjectById(123)
geo = cd.geolocation
print geoThis 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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login