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.

delete all objects without tag
#2
Use this, change the tag name as needed. And make a backup just in case Smile
Code:
tag = 'test'

tagged = {}

objs = grp.tag(tag)
for _, obj in ipairs(objs) do
  tagged[ obj.address ] = true
end

objs = grp.all()
for _, obj in ipairs(objs) do
  if not tagged[ obj.address ] then
    grp.delete(obj.address)
  end
end
Reply


Messages In This Thread
RE: delete all objects without tag - by admin - 28.06.2022, 09:47

Forum Jump: