'\" t
.\"     Title: KILLTREE
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 04/13/2022
.\"    Manual: BRL-CAD User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "KILLTREE" "nged" "04/13/2022" "BRL\-CAD" "BRL\-CAD User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
killtree \- Deletes the specified \fIobjects\fR from the current database and recursively deletes all objects referenced by any of those objects\&.
.SH "SYNOPSIS"
.HP \w'\fBkilltree\fR\ 'u
\fBkilltree\fR [\-a] [\-f] [\-n] {\fIobjects\fR}
.SH "DESCRIPTION"
.PP
All specified
\fIobjects\fR
are immediately deleted if they are top\-level objects not referenced elsewhere in the database\&. For each combination among the listed
\fIobjects\fR, 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\&.
.PP
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
\fB\-a\fR
flag is not specified\&.
.PP
\fB\-a\fR
.RS 4
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
\fBkillall object\fR
on each member of the specified object hierarchy\&.
.RE
.PP
\fB\-f\fR
.RS 4
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
\fB\-a\fR
flag\&.
.RE
.PP
\fB\-n\fR
.RS 4
The
\fB\-n\fR
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\&.
.RE
.PP
\fBUse this command with caution\&.\fR
Killed objects cannot be recovered so
\fBkeep\fR
a backup\&.
.SH "EXAMPLES"
.PP
The example shows the use of the
\fBkilltree\fR
command to delete specified objects and all references to them from the current database\&.
.PP
\fBExample\ \&1.\ \&Delete objects and all references to them from the database.\fR
.PP
mged> \fBkilltree \-a group1 region2 shapeb\fR
.RS 4
Destroys
\fIgroup1\fR,
\fIregion2\fR, and
\fIshapeb\fR
and removes all references to these objects from the database\&.
.RE
.SH "SEE ALSO"
.PP

\fBkill\fR(nged)
\fBkillall\fR(nged)
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
