KILLTREE

## Name

killtree — Deletes the specified objects from the current database and recursively deletes all objects referenced by any of those objects.

## Synopsis

`killtree` [-a] [-f] [-n] {`objects`}

## DESCRIPTION

All specified objects are immediately deleted if they are top-level objects not referenced elsewhere in the database. For each combination among the listed objects, the combination as well as any objects that are members of that combination will be deleted. If a member of that combination is itself a combination, then all of its members will also be destroyed. This continues recursively until the primitive shapes are reached and destroyed.

By default, if only some members of an object hierarchy are unique to the hierarchy, these members are deleted but members referenced elsewhere are retained. This means that this command may invalidate object hierarchies if the `-a` flag is not specified.

`-a`

  If any specified object or any of its members is referenced elsewhere in the database, kill it anyway. Then kill all references to the killed object. This is equivalent to running killall object on each member of the specified object hierarchy.

`-f`

  If any specified object or any of its members is referenced elsewhere in the database, kill it anyway. Using this flag may result in dangling references elsewhere in the database. Note that this flag has no effect if used in conjunction with the `-a` flag.

`-n`

  The `-n` flag causes no objects to be actually killed. Instead, a list of objects that would be killed is returned. This can be useful for testing or scripting.

Use this command with caution. Killed objects cannot be recovered so keep a backup.

## EXAMPLES

The example shows the use of the killtree command to delete specified objects and all references to them from the current database.

Example 1. Delete objects and all references to them from the database.

`mged>` `killtree -a group1 region2 shapeb`

  Destroys group1, region2, and shapeb and removes all references to these objects from the database.

## SEE ALSO

kill(nged) killall(nged)

## AUTHOR

BRL-CAD Team

## BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to `<devs@brlcad.org>`