parameters: (ob)
return_statement: return "0"
docstring: Get the name of the group or Draft layer that contains the object.
  
      It looks for the global `dxfUseDraftVisGroup` variable defined
      in `readPreferences`. Then searches all objects of type "Layer"
      for the one that contains `ob`.
  
      Otherwise, it searches all objects derived from
      `App::DocumentObjectGroup` for the one that contains `ob`.
  
      Parameters
      ----------
      ob : App::DocumentObject
          Any object to test as belonging to a layer or group.
  
      Returns
      -------
      str
          The label of the layer, or of the group, if it contains `ob`.
          Otherwise, return "0".
  
      To do
      -----
      Use local variables, not global variables.
docstring_summary: Get the name of the group or Draft layer that contains the object.
docstring_tokens: Get the name of the group or Draft layer that contains the object .
function: def getGroup(ob):
      """Get the name of the group or Draft layer that contains the object.
  
      It looks for the global `dxfUseDraftVisGroup` variable defined
      in `readPreferences`. Then searches all objects of type "Layer"
      for the one that contains `ob`.
  
      Otherwise, it searches all objects derived from
      `App::DocumentObjectGroup` for the one that contains `ob`.
  
      Parameters
      ----------
      ob : App::DocumentObject
          Any object to test as belonging to a layer or group.
  
      Returns
      -------
      str
          The label of the layer, or of the group, if it contains `ob`.
          Otherwise, return "0".
  
      To do
      -----
      Use local variables, not global variables.
      """
      all_objs = FreeCAD.ActiveDocument.Objects
      if dxfUseDraftVisGroups:
          for layer in [o for o in all_objs if Draft.getType(o) == "Layer"]:
              if ob in layer.Group:
                  return layer.Label
      for i in all_objs:
          if i.isDerivedFrom("App::DocumentObjectGroup"):
              for j in i.Group:
                  if j == ob:
                      return i.Label
      return "0"
function_tokens: def getGroup ( ob ) : all_objs = FreeCAD . ActiveDocument . Objects if dxfUseDraftVisGroups : for layer in [ o for o in all_objs if Draft . getType ( o ) == "Layer" ] : if ob in layer . Group : return layer . Label for i in all_objs : if i . isDerivedFrom ( "App::DocumentObjectGroup" ) : for j in i . Group : if j == ob : return i . Label return "0"