<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[NxShell Link color based on Objects]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I am adding links to my maps using nxshell.<br />
With the following code the link is not reflecting the Object status.</p>
<pre><code>from java.util import ArrayList

ltype = NetworkMapLink.NORMAL
cd = NetworkMapLink(ltype,4885,4943)
sList = ArrayList()
sList.add(4917)
sList.add(4943)
cd.setStatusObjects(sList)
cd.setRouting(NetworkMapLink.ROUTING_DIRECT)
cd.setColorSource(LinkConfig.COLOR_SOURCE_OBJECT_STATUS)

amap = s.findObjectById(5036)
mapPage = amap.createMapPage()
mapPage.addLink(cd)

data = NXCObjectModificationData(5036)
data.setMapContent(mapPage.getElements(), mapPage.getLinks())
s.modifyObject(data)
</code></pre>
<p dir="auto">There is a LinkConfig object but I don't see how it should be applied to the Links:</p>
<pre><code>lc = cd.getConfig()
lc.setColorSource(LinkConfig.COLOR_SOURCE_OBJECT_STATUS)
lc.setObjectStatusList(sList)
</code></pre>
]]></description><link>https://forum.netxms.org/topic/6348/nxshell-link-color-based-on-objects</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 13:19:38 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6348.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Dec 2019 14:24:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NxShell Link color based on Objects on Thu, 02 Jan 2020 16:36:34 GMT]]></title><description><![CDATA[<p dir="auto">There's a couple of minor things that are causing issues here. NetworkMapLink expects IDs within map, not netxms object IDs, so there's a function to convert. And we need to explicitly specify that IDs of status-providing nodes are of type "Long". Here's an example of working script:</p>
<pre><code>from java.util import ArrayList
from java.lang import Long

amap = s.findObjectById(2722)
mapPage = amap.createMapPage()

cd = NetworkMapLink(NetworkMapLink.NORMAL, mapPage.findObjectElement(672).id, mapPage.findObjectElement(674).id)

sList = ArrayList()
sList.add(Long(674))
sList.add(Long(672))

cd.setStatusObjects(sList)

cd.setRouting(NetworkMapLink.ROUTING_DIRECT)
cd.setColorSource(LinkConfig.COLOR_SOURCE_OBJECT_STATUS)

mapPage.addLink(cd)

data = NXCObjectModificationData(2722)
data.setMapContent(mapPage.getElements(), mapPage.getLinks())
s.modifyObject(data)
</code></pre>
]]></description><link>https://forum.netxms.org/post/27212</link><guid isPermaLink="true">https://forum.netxms.org/post/27212</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Thu, 02 Jan 2020 16:36:34 GMT</pubDate></item></channel></rss>