This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Adding Tag to multiple objects
#1
Hello,

I'm pretty new to LogicMachine and I got one simple issue I'm trying to fix.
My goal here is to add a tag to a lot of objects. To be more precise, I would like to add the tag 'ENSLG_LOGS_CLIENT' to all the objects wich address start with '1/*/*'

So far I have found this script :

*******
ListeObjets={} ---Liste contenant les strings des adresses des objets (ex: {'1/1/1','1/1/2'})
ListeTags={}  ---Liste de strings contenant les tags (ex: {'ENSLG_MA', 'PMA0'}, {'PMA0'})

for i, obj in ipairs(ListeObjets) do
  grp.addtags(obj,ListeTags)
end

script.disable('Ajouter tags à des objets')

********

This script adds all the tags in 'ListeTags' to the objects which addresses are referred in 'ListeObjets'
I would like to be able to apply the tags to all the objects with their addresses starting with '1/*/*' rather than typing each addresses myself in 'ListObjets'
I thought of using a for loop to increment the adresses, but as I've just started using LogicMachine I'm not confortable with the scripting and I could really use a hand.

Thanks for reading me !

Matthieu Papillon
Reply


Messages In This Thread
Adding Tag to multiple objects - by PAPILLON - 27.10.2021, 11:09
RE: Adding Tag to multiple objects - by admin - 27.10.2021, 12:13

Forum Jump: