21.01.2019, 21:51
(This post was last modified: 21.01.2019, 21:54 by Erwin van der Zwart.)
Hi,
grp.tag will always return a table with objects so this is never true or false..
Here are the needed scripts for logical and/or by TAG:
BR,
Erwin
grp.tag will always return a table with objects so this is never true or false..
Here are the needed scripts for logical and/or by TAG:
Code:
-- Logical OR port by tagged objects
tagname = 'OR_LOGIC'
output = '1/1/1'
for i, object in ipairs(grp.tag(tagname)) do
if object.data then
grp.checkwrite(output, true, 1)
return
end
end
grp.checkwrite(output, false, 1)
Code:
-- Logical AND port by tagged objects
tagname = 'AND_LOGIC'
output = '1/1/1'
for i, object in ipairs(grp.tag(tagname)) do
if not object.data then
grp.checkwrite(output, false, 1)
return
end
end
grp.checkwrite(output, true, 1)
Erwin