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.

export and create copy with new objects
#1
I have 50 objects with addresses starting 3/0 / ...

I want to create a copy of objects with addresses (3/1 ...), while adding a certain text to the new name (for example: the old name "light on/off", the new name "light on/off status")

thank you in advance
Reply
#2
Code:
-- from 3/0/1 to 3/0/50
addrstart = 1
addrend = 50

for addr = addrstart, addrend do
  obj = grp.find('3/0/' .. addr)

  if obj then
    grp.create({
      datatype = obj.datatype,
      address = '3/1/' .. addr,
      name = obj.name .. ' status',
    })
  end
end
Reply


Forum Jump: