I'm trying to get back all the tokens on the Object layer that are within 500 pixels of the calling token, so my conditional json looks like...
{"range":{"upto":500,"metric":"NO_GRID","token":"0000000095C600855203000000000000"},"layer":"Object"}
However, when I call "getTokens" with this, I get back ALL the tokens on the Object layer, no matter the distance from the calling token. Am I doing this wrong?
getTokens range with No_Grid question
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: getTokens range with No_Grid question
Maybe include distancePerCell parameter because despite having no grid there is a cell size set and perhaps the default is 1.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: getTokens range with No_Grid question
So I tried that both ways but I'm still getting everything on the object layer
The grid is set at 150, so you can see that the cars are clearly more than 50 away from the oil slick. But this (where the distancePerCell is set to 1, 0, or ommitted)...
...is still returning the oil slick, when it should be out of range.
Any other ideas?
The grid is set at 150, so you can see that the cars are clearly more than 50 away from the oil slick. But this (where the distancePerCell is set to 1, 0, or ommitted)...
Code: Select all
[h: cond = '{ "range": {"upto":50, "distancePerCell " : 0, "metric" : "NO_GRID", "token":"' + Car + '"}, "layer": "Object"}']
[h: AllDropped = getTokens("json", cond)]
Any other ideas?
Re: getTokens range with No_Grid question
My other option is just to use this, then do a distance check to each token and if its within 50, then perform the calculations on it. But that's extra work/processing that I had thought "getTokens" would effectively handle for me.
Re: getTokens range with No_Grid question
Figured out the problem...I had the Pixels per cell set to 150 but NOT the Distance per cell. That was set (for some reason) to 15, so was messing everything up.
getTokens is now working fine!
getTokens is now working fine!