On 22/07/2015 at 01:59, xxxxxxxx wrote:
for modeling operations you could use SendModelingCommand(). In this case you could use MCOMMAND_DELETE to delete the selected polygons of a polygon object. So in a first step you have to find out what polygons you want to delete. Then you would have to set that selection by accessing the BaseSelect object with GetPolygonS(). In this example "op" is the current object and must be a polygon object:
selection = op.GetPolygonS()
# clear existing selection
# define a new selection
mode = c4d.MODELINGCOMMANDMODE_POLYGONSELECTION
c4d.utils.SendModelingCommand(c4d.MCOMMAND_DELETE, list = [op], doc = doc, mode = mode)
Another way would be to handle the polygon data inside the polygon object itself. The Remove() function only exist for objects based on GeListNode and is used to remove an object from a linked list. The polygon data returned by GetAllPolygons() is just a python list with CPolygon objects. So if you want to handle the polygon object yourself would have to store the current polygons, then resize the polygon object with ResizeObject() and rebuild the polygon data by adding just the desired polygons.