## Name

db — Provides an interface to a number of database manipulation routines.

## Synopsis

`db` {`command`} [`arguments`]

## DESCRIPTION

Provides an interface to a number of database manipulation routines. Note that this command always operates in units of millimeters. The command must be one of the following with appropriate arguments:

match [regular_exp]

  Returns a list of all objects in that database that match the list of regular expressions.

get shape_or_path [attribute]

  Returns information about the primitive shape at the end of the shape_or_path. If a path is specified, the transformation matrices encountered along that path will be accumulated and applied to the leaf shape before displaying the information. If no attribute is specified, all the details about the shape are returned. If a specific attribute is listed, then only that information is returned.

put shape_name shape_type attributes

  Creates shape named shape_name of type shape_type with attributes as listed in attributes. The arguments to the put command are the same as those returned by the get command.

adjust shape_name attribute new_value1 [new_value2 new_value3...]

  Modifies the shape named shape_name by adjusting the value of its attribute to the new_values.

form object_type

  Displays the format used to display objects of type object_type.

tops

  Returns all top-level objects.

close

  Closes the previously opened database and deletes the associated command.

## EXAMPLES

The following examples show the uses of the db command to list various objects and attributes from the database, as well as to create new TGC shapes, adjust a vertex attribute, and display command formats.

Example 1. List all objects in the database that end with ".s"

`mged>` `db match *.s`

  Gets a list of all objects in the database that end with .s.

Example 2. List all attributes and their values for cone.s

`mged>``db get cone.s`

Gets a list of all the attributes and their values for shape cone.s.

Example 3. Get the value of the vertex attribute of cone.s

`mged>``db get cone.s V`

Gets the value of the V (vertex) attribute of shape cone.s

Example 4. Create a new TGC shape named new_cone.s with specified attributes.

`mged>``db put new_cone.s tgc V {0 0 0} H {0 0 1} A {1 0 0} B {0 1 0} C {5 0 0} D {0 5 0}`

Creates a new TGC shape named new_cone.s with the specified attributes.

Example 5. Adjust the vertex attribute of new_cone.s to a given value.

`mged>``db adjust new_cone.s V {0 0 10}`

Adjusts the V (vertex) attribute of new_cone.s to the value {0 0 10}.

Example 6. Display the format used by the get and put commands for the TGC shape type.

`mged>``db form tgc`

Displays the format used by the get and put commands for the TGC shape type.

## BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to <devs@brlcad.org>, or via the "cadbug.sh" script.