Erik Kostson
Ansys Employee

 

Say the named selection is called “MyBodyNamedSelection”
Sample code:

laySect = Model.Geometry.AddLayeredSection()

ExtAPI.SelectionManager.ClearSelection()
ns = ExtAPI.DataModel.GetObjectsByName(“MyBodyNamedSelection”)
laySect.Location = ns[0]