pymel.core.system.dbcount

dbcount(*args, **kwargs)

The dbcountcommand is used to print and manage a list of statistics collected for counting operations. These statistics are displayed as a list of hits on a particular location in code, with added reference information for pointers/strings/whatever. If -reset is not specified then statistics are printed.

Flags:

Long Name / Short Name Argument Types Properties
enabled / e bool ../../../_images/create.gif
  Set the enabled state of the counters (‘on’ to enable, ‘off’ to disable). Returns the list of all counters affected.
file / f unicode ../../../_images/create.gif
  Destination file of the enabled count objects. Use the special names stdoutand stderrto redirect to your command window. As well, the special name msdevis available on NT to direct your output to the debug tab in the output window of Developer Studio.
keyword / k unicode ../../../_images/create.gif
  Print only the counters whose name matches this keyword (default is all).
list / l bool ../../../_images/create.gif
  List all available counters and their current enabled status. (The only thing you can do when counters are disabled.)
maxdepth / md int ../../../_images/create.gif
  Maximum number of levels down to traverse and report. 0 is the default and it means continue recursing as many times as are requested.
quick / q bool ../../../_images/create.gif
  Display only a summary for each counter type instead of the full details.
reset / r bool ../../../_images/create.gif
  Reset all counters back to 0 and remove all but the top level counters. Returns the list of all counters affected.
spreadsheet / s bool ../../../_images/create.gif
  Display in spreadsheet format instead of the usual nested braces. This will include a header row that contains ‘Count Level1 Level2 Level3...’, making the data suitable for opening directly in a spreadsheet table. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.dbcount

Example:

import pymel.core as pm

pm.dbcount( e='on' )              # Enable counters
pm.dbcount( )                     # Print all available counters
pm.dbcount( f='myCounts.txt' )    # Print all available counters to the file "myCounts.txt"
pm.dbcount( k='dirty' )           # Print all counters with "dirty" in their name
pm.dbcount( r=True, k='dirty' )   # Reset counters with "dirty" in their name
pm.dbcount( l=True )              # List all counters
pm.dbcount( l=True, k='dirty' )   # List all counters with "dirty" in their name
pm.dbcount( s=True, f='xls.txt' ) # Print all counters in spreadsheet form to the file "xls.txt"