How can I get all the sweepable objects in my model by scripting?

M
M Member, Employee Posts: 238
50 Answers 100 Comments 100 Likes First Anniversary
✭✭✭✭

Sweepable objects have some properties that make them useful in certain mesh functions. So it is nice to be able to have all sweepables in one named selection.
This can be done with a few lines of script.

  1. Use the mesh item in the tree to Show sweepable bodies
  2. use the Selection manager to access the active/selection
  3. Write those to a name selection called Sweepables
mesh = API.DataModel.Project.Model.Mesh
sweepables = mesh.ShowSweepableBodies()
SM = ExtAPI.SelectionManager
CurrentSelection=SM.CurrentSelection
ns = ExtAPI.DataModel.Project.Model.AddNamedSelection()
ns.Name = 'Sweepables'
ns.Location = CurrentSelection

Thanx 2 @Rohith Patchigolla