Point & Poly Select Functions

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

On 01/04/2011 at 01:59, xxxxxxxx wrote:

I was hoping to get some advice on how to properly use the following functions that are part of c4d.BaseSelect()

Snippets that don't work as I would expect

  
    #Select all points and polys   
    point_select.SelectAll(0, point_count)   
    poly_select.SelectAll(0, poly_count)   

My Full Source Code

  
"""   
Select All Polygons   
-------------------------------   
Open Source - Free for all   
  
Originally written by:   
    Donovan Keith   
    [email protected]   
  
Last Edit: 04/01/2011   
"""   
  
import c4d   
from c4d import gui, documents   
  
def main() :   
    #Get active document   
    doc = documents.GetActiveDocument()   
    if not doc:   
        gui.MessageDialog("No active document.")   
        return False   
  
    #Get first active object   
    op = doc.GetActiveObject()   
    if not op or not op.CheckType(c4d.Opolygon) :   
        gui.MessageDialog("No poly objected selected")   
        return False   
  
    #Get point and polygon selections and counts   
    point_select = op.GetPointS()   
    poly_select = op.GetPolygonS()   
  
    point_count = op.GetPointCount()   
    poly_count = op.GetPolygonCount()   
  
  
    #Select all points and polys   
    point_select.SelectAll(0, point_count)   
    poly_select.SelectAll(0, poly_count)   
  
    #Alert C4D something has changed   
    c4d.EventAdd()   
  
if __name__=='__main__':   
    main()   

What am I doing incorrectly? I can properly select and deselect elements using .Select() and .Deselect(), but no joy otherwise.
Thanks,

Donovan

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

On 01/04/2011 at 03:11, xxxxxxxx wrote:

Hi, did you upgrade to R12.043? There are some fixes in BaseSelect. Cheers, Sebastian

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

On 01/04/2011 at 17:36, xxxxxxxx wrote:

Hi Sebastian,

Yes, I'm running 12.043. Does my script as posted above select all points and polygons for you, as it does nothing here?
Thanks,

Donovan

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

On 01/04/2011 at 17:53, xxxxxxxx wrote:

Your script seems to be alright.
Alternatively, you can use this:

  
def SelectAll(bs,max) :   
    for i in range(max) : bs.Select(i)   

Cheers, nux

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

On 20/05/2011 at 14:18, xxxxxxxx wrote:

Okay, for whatever reason the bs.SelectAll(min,max) function is not working for me, but bs.Select(i) is. Thanks nux95!

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

On 20/05/2011 at 15:01, xxxxxxxx wrote:

bs.ToggleAll() isn't working for me either. Odd. Can anyone else confirm that these functions aren't working? Or is it something to do with my installation?

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

On 01/06/2011 at 09:32, xxxxxxxx wrote:

@Donovan: What is wrong with ToggleAll? It works fine here (r12.043).