ConvertSelection



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

    On 06/04/2005 at 06:09, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.503 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    I'm trying to convert a point selection into an edge selection to set a phong break on a polygon object. However, I can't seem to get the SendModellingCommand to do anything...

    Heres what I'm doing (assuming I have a active point selection)

      
    var data2=new(BaseContainer);  
      
    data2->SetData(MDATA_CONVERTSELECTION_LEFT,IDC_CONVERTSELECTION_LEFT_1);//Set From to "Points"  
    data2->SetData(MDATA_CONVERTSELECTION_RIGHT,IDC_CONVERTSELECTION_RIGHT_2);//Set To to "Edges"  
    data2->SetData(MDATA_CONVERTSELECTION_TOLERANT,FALSE);//No tolerant conversion  
      
    SendModelingCommand(MCOMMAND_CONVERTSELECTION,doc,obj,data2,MODIFY_ALL);  
    

    But this code does absolutely nothing as far as I can see, the edge selection stays empty. Could anyone please point me in the right direction here? Or is there maybe another waay to select the edges of an object?

    Thanks in advance,

    Mike



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

    On 10/04/2005 at 13:56, xxxxxxxx wrote:

    I can't confirm this. Putting the following code into an expression tag on a polygon object should make sure that the edge selection is synchronized to the point selection, and that seems to work here.

        
        
        const var MDATA_CONVERTSELECTION_LEFT = 2126; // LONG  
        const var MDATA_CONVERTSELECTION_RIGHT = 2127; // LONG  
        const var MDATA_CONVERTSELECTION_TOLERANT = 2128; // BOOL  
        const var MCOMMAND_CONVERTSELECTION = 247;
        
        
        
        
        main(doc,op)  
        {  
          var data2=new(BaseContainer);
        
        
        
        
          data2->SetData(MDATA_CONVERTSELECTION_LEFT, 0);//Set From to "Points"  
          data2->SetData(MDATA_CONVERTSELECTION_RIGHT ,1);//Set To to "Edges"  
          data2->SetData(MDATA_CONVERTSELECTION_TOLERANT, FALSE);//No tolerant conversion
        
        
        
        
          SendModelingCommand(MCOMMAND_CONVERTSELECTION,doc,op,data2,MODIFY_ALL);  
        }
    

    Note: unlike the Convert Selection dialog, the selection mode won't be changed to edge selection after the conversion. Changing the selection mode from C.O.F.F.E.E. requires C4D R9.1.



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

    On 11/04/2005 at 00:14, xxxxxxxx wrote:

    Thanks, now it works. Seems my failure was to use IDC_CONVERTSELECTION_LEFT_1 and _RIGHT_1 as value for the MDATA_CONVERTSELECTION_LEFT and _LEFT data. With 0 and 1 it works like a charm!


Log in to reply