I'm looking for an ACT command that selects all elements that are connected to a line. In MAPDL this command was called ESLL. Currently my script, which saves the elements in a named selection, looks kind of clunky:
geo_body = geo_data.GeoEntityById (line_body) # Get geoEdgeWrapper id
tree_body = tree_geometrie.GetBody (geo_body) # get connected body in tree
sel.Ids = [geo_body.Id] # construct selection from id
## Results
namedSel = ExtAPI.DataModel.Project.Model.NamedSelections.AddNamedSelection ()
namedSel.Name = tree_body.Name + '_elements'
namedSel.ScopingMethod = GeometryDefineByType.Worksheet
namedSel.GenerationCriteria.Add (None)
namedSel.GenerationCriteria [0] .EntityType = SelectionType.GeoBody
namedSel.GenerationCriteria [0] .Criterion = SelectionCriterionType.Name
namedSel.GenerationCriteria [0] .Operator = SelectionOperatorType.Equal
namedSel.GenerationCriteria [0] .Value = tree_body.Name
namedSel.GenerationCriteria.Add (None)
namedSel.GenerationCriteria [1] .Action = SelectionActionType.Convert
namedSel.GenerationCriteria [1] .EntityType = SelectionType.MeshElement
namedSel.Generate ()