GetSelectionTag Name



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/02/2012 at 12:03, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:    
    Platform:      
    Language(s) :

    ---------
    Hi,
    I'm trying to get the name of the Selection. For example i've a cube and added a selection tag. changed the name from Polygon-selection to Test. The problem i got is that it always return the default name "polygon-selection".

     BaseSelect bs = st.GetBaseSelect();
                            bs.Select(0);
                            if (bs.IsSelected(0))
                            {
                                BaseTag bt = BaseTag.Alloc(C4dApi.Tpolygonselection);
                                
                                selekname = bt.GetName();
                                C4dApi.GePrint("Die eingefrorene Selektion heißt: " + bt.GetName());
                               
                            }
    


  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/02/2012 at 15:48, xxxxxxxx wrote:

    In the code you posted you haven't changed the tag name. I take it 'st' is a selection tag and that its name in the OM is 'Test'. Then you create another tag 'bt' of type Tpolygonselection, and then read that tag's name. Not surprisingly, the name is 'Polygon Selection' which is the default name given to tags of that type.

    You either have to read st's name to get 'Test' back, or change the name of bt after you created it.

    Steve



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/02/2012 at 17:32, xxxxxxxx wrote:

    I changed it in the Attribute Manager
    http://imageshack.us/f/684/testob.png/



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/02/2012 at 00:04, xxxxxxxx wrote:

    You should have changed your code...
    Your code prints the name of the newly allocated SelectionTag bt. And that's the default name, you're seeing on the console. As spedler said, you probably want to print the name of st.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/02/2012 at 09:02, xxxxxxxx wrote:

    I did but i get the same thats why i posted the image
    OK i got it

    BaseObject op2 = b2.GetObjectLink(SKELETT_OBJ_AUSWAHL, doc2);
                        BaseTag t = op2.GetTag(C4dApi.Tpolygonselection);
                    and then get the name of "t "
    the only problem i get now is if the object has more selectiontags and i try to get their names. C4D Crashes 
    I tried to use the GetNext() function and after it the GetName() again
    like this

     BaseObject op2 = b2.GetObjectLink(OBJ_AUSWAHL, doc2);
                        BaseTag t = op2.GetTag(C4dApi.Tpolygonselection);
                        string selekname = t.GetName();
                        t.GetNext();
                        C4dApi.GePrint("name : "+t.GetName());
                        BaseObject j = this.wtagGlob.GetJoint(1, doc2);
                        C4dApi.GePrint("Knochenname "+j.GetName());
                        string joinName = j.GetName();
      
      
    
    

    I should have added the index of the selection tag lol...


Log in to reply