It is possible to visualize a tool ONLY when an object is located?

Yes – this can be done in tool eventhandlers. Modify the endExecute event.

def endExecute(self): # use to get this tool instance # Return 1 for OK, 0 for error t=GetTool( t.visible = (t.getIntValue('Count') >= GetIntValue('Setup.PelletsLimit')) return 1

The tool visible property is True if the Count is high.