kill only one tag / not all [SOLVED]

On 12/05/2015 at 15:42, xxxxxxxx wrote:

Hello,

t try to kill a tag.
Not all tags of a selected type.

I' allready have found the Tag

  
    for tag in taglist:   
        if sel_name != tag[c4d.TEXTURETAG_RESTRICTION]:   
            print "delete"   
            print tag[c4d.TEXTURETAG_RESTRICTION]   
            obj.KillTag(c4d.Ttexture)   

But obj.KillTag(c4d.Ttexture) delets all Texture-Tags.
I only whant to delete the tag whitch does not match to the sel_name.

Does anybody has an Idea how to delete only one Tag?

Thanks

On 13/05/2015 at 01:38, xxxxxxxx wrote:

Does nobody has an idea???
Maybe it is so f**king easy that nobudy will give me an advice???

Ronald

On 13/05/2015 at 02:04, xxxxxxxx wrote:

Hi,

actually it should be enough to simply call tag.Remove().

On 13/05/2015 at 02:09, xxxxxxxx wrote:

I'm too, prefer remove

Kissling post more code  - i'm lazy to add more 😉

a few mods:

Not all tags of a selected type.

import c4d  
from c4d import gui  
#Welcome to the world of Python  
  
def main() :  
  taglist = doc.GetActiveTags()  
  sel_name = "Polygon Selection.1"  
  for tag in taglist:  
      if sel_name != tag[c4d.TEXTURETAG_RESTRICTION] and tag.GetType() == c4d.Ttexture:  
          print "delete"  
          print tag[c4d.TEXTURETAG_RESTRICTION]  
          tag.Remove()  
  c4d.EventAdd()  
  
if __name__=='__main__':  
  main()

On 13/05/2015 at 03:03, xxxxxxxx wrote:

Oh my good

So easy !!!!
Thanks a lot
Ronald