# Select Geometry Only

**URL:** https://forum.highend3d.com/t/select-geometry-only/2711
**Category:** Maya
**Tags:** mel
**Created:** [November 6, 2006, 10:26am UTC](https://forum.highend3d.com/t/select-geometry-only/2711 "2006-11-06T10:26:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![andy-davis](https://forum.highend3d.com/user_avatar/forum.highend3d.com/andy-davis/32/56562_2.png) [@andy-davis](https://forum.highend3d.com/u/andy-davis)
#### Post date: [November 6, 2006, 10:26am UTC](https://forum.highend3d.com/t/select-geometry-only/2711/1 "2006-11-06T10:26:59Z")

</div>

Heres a quickie for a newbie!  
How do I mel code the menu command Edit\>Select All By Type\>Geometry ?

---

<div class="post-metadata">

### Author: ![naughty](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/n/35a633/32.png) [@naughty](https://forum.highend3d.com/u/naughty)
#### Post date: [November 6, 2006, 10:58am UTC](https://forum.highend3d.com/t/select-geometry-only/2711/2 "2006-11-06T10:58:56Z")

</div>

open up your script editor and chose from it's script menu: "Echo All Commands"

this shows EVERYTHING (almost) that happens in MEL. now you've done this, simply select Edit\>Select All By Type\>Geometry and the script editor will show you the exact MEL that this executes.

CODE  
SelectAllGeometry;  
select -r `listTransforms -geometry`;

the only thing you need to realize is the the second line here is actually the MEL that is called by the scripted command SelectAllGeometry, so you could use either of those loines (but not both)

(p.s. don't forget to turn OFF "Echo All Commands" when you're done.)

:nathaN

---

<div class="post-metadata">

### Author: ![payamlight](https://forum.highend3d.com/user_avatar/forum.highend3d.com/payamlight/32/5999_2.png) [@payamlight](https://forum.highend3d.com/u/payamlight)
#### Post date: [September 7, 2017, 6:37pm UTC](https://forum.highend3d.com/t/select-geometry-only/2711/3 "2017-09-07T18:37:53Z")

</div>

mel  
select -r listTransforms -geometry;

Python

mport maya.cmds as cmds

cmds.SelectAllGeometry()

or

cmds.select(cmds.listRelatives(cmds.ls(geometry=True), p=True, path=True), r=True)
