CallCommand 12139 + ctrl

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

On 10/02/2012 at 06:00, xxxxxxxx wrote:

User Information:
Cinema 4D Version:    
Platform:      Mac OSX  ; 
Language(s) :       PYTHON  ;

---------
Moving  to points mode 
needs a call to 
c4d.CallCommand(12139)

Q: if you want to do the same thing but with a key modifier - CTRL

is there any 'easy' way to do this?

ie go from a poly or edge selection - and convert that straight to a point selection?

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

On 10/02/2012 at 07:56, xxxxxxxx wrote:

I'm not sure if I understand you correctly.
But it sounds like you might want to use the convert tool with SMC.

Here's an example that will select the edges around the selected polygons.
The advantage to doing it this way- VS.- using the CallCommand() is you don't have to switch into edge mode first to select the edges.

import c4d  
from c4d import utils  
  
def main() :  
      obj = doc.GetActiveObject()    
      bc = c4d.BaseContainer()  
      bc.SetData(c4d.MDATA_CONVERTSELECTION_LEFT, 2)        #ConvertSelection's Left "Polygons" option in memory  
      bc.SetData(c4d.MDATA_CONVERTSELECTION_RIGHT, 1)       #ConvertSelection's Right "Edges" option in memory  
      bc.SetData(c4d.MDATA_CONVERTSELECTION_TOLERANT, True) #Select the selection->ConvertSelection's "Tolerant" option in memory  
      utils.SendModelingCommand(c4d.MCOMMAND_CONVERTSELECTION, list = [obj], mode = c4d.MODIFY_ALL, bc=bc, doc = doc)      
  
if __name__=='__main__':  
  main()

-ScottA

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

On 10/02/2012 at 12:26, xxxxxxxx wrote:

Don't understand the 'right'  'left' thing Scott
but I bet if I dig in the SDK it will become clear

bottom line -  just trying to get from a poly selection..... straight to the equivalent point selection

ie like  Tool change -  PLUS -  CNTRL KEY

will give your code a spin later

ta

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

On 10/02/2012 at 13:28, xxxxxxxx wrote:

In R12: in the top menu go to->Selection->And select the Convert Selection Tool
Or In R13: in the top menu go to->Select->And select the Convert Selection Tool

The window that pops up has options on the left & right to convert the selected edges,polys,points to being selected in a different mode. Just like when you hold down the Ctrl key.

That's what those right and left comments are referring to.

-ScottA

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

On 11/02/2012 at 05:56, xxxxxxxx wrote:

a ha!

thanks (yet) again

On 18/05/2016 at 02:02, xxxxxxxx wrote:

Hi,
I am trying to get this script working under R17
but it doesn't seem to work.
Is there something that have change in how python works?

def main() :
      obj = doc.GetActiveObject() 
      bc = c4d.BaseContainer()
      bc.SetData(c4d.MDATA_CONVERTSELECTION_LEFT, 2)        #ConvertSelection's Left "Polygons" option in memory
      bc.SetData(c4d.MDATA_CONVERTSELECTION_RIGHT, 1)       #ConvertSelection's Right "Edges" option in memory
      bc.SetData(c4d.MDATA_CONVERTSELECTION_TOLERANT, True) #Select the selection->ConvertSelection's "Tolerant" option in memory
      utils.SendModelingCommand(c4d.MCOMMAND_CONVERTSELECTION, list = [obj], mode = c4d.MODIFY_ALL, bc=bc, doc = doc)

if __name__=='__main__':
  main()

On 18/05/2016 at 07:44, xxxxxxxx wrote:

Originally posted by xxxxxxxx

Hi,
I am trying to get this script working under R17
...

Works here as expected. Where's the problem? What tells the console output?

On 18/05/2016 at 09:04, xxxxxxxx wrote:

Works here as expected. Where's the problem? What tells the console output?

I'm quite new to python. At first I was perplexed when it didn't change to the mode as when I use the Convert selection Window. But I see now that i need an extra part in the script to do that. I those have shortcuts set up in COFFEE

CallCommand(200000083); // Live Selection
CallCommand(16351); // Edges

How can I get this scripts to work in Python?