<!-- Converted by db4-upgrade version 1.0 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="opendb">

<refmeta>
  <refentrytitle>OPENDB</refentrytitle>
  <manvolnum>nged</manvolnum>
  <refmiscinfo class="source">BRL-CAD</refmiscinfo>
  <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
</refmeta>

<refnamediv xml:id="name">
  <refname>opendb</refname>
  <refpurpose>Closes the current database file and opens <emphasis>database.g</emphasis>.
   </refpurpose>
</refnamediv>

<!-- body begins here -->
<refsynopsisdiv xml:id="synopsis">
  <cmdsynopsis sepchar=" ">
    <command>opendb</command>
      <arg choice="opt" rep="norepeat">-f</arg>
      <arg choice="opt" rep="norepeat"><replaceable>database.g</replaceable></arg>
    </cmdsynopsis>
</refsynopsisdiv>

<refsection xml:id="description"><info><title>DESCRIPTION</title></info>
  
  <para>Closes the current database file and
    opens <emphasis>database.g</emphasis>.
    If <emphasis>database.g</emphasis> is not found, the current
    database is left open.  If <emphasis> database.g</emphasis> is not
    specified on the command line, the name of the current database
    file is returned.
  </para>
  <para>If the -f option is specified and the database.g is a v4
     geometry database, the file will be read with a flipped binary
     endianness encoding.  This is useful for binary-incompatible v4
     geometry files that were created on a different platform type.
  </para>
  <para>Binary-incompatible v4 geometry database files that can be
    auto-detected will be automatically converted if all resulting
    matrices are valid.
  </para>
</refsection>

<refsection xml:id="examples"><info><title>EXAMPLES</title></info>
  
  <para>The first example shows the use of
    the <command>opendb</command> command to close the current
    database file and open the one specified.  The second example
    shows the use of the command with no database name, which returns
    the name of the current database file.
  </para>
  <example><info><title>Close the current database and open another one.</title></info>
    
    <para>
      <prompt>mged&gt;</prompt><userinput>opendb model.g</userinput>
    </para>
    <para>Closes the current database file and opens <emphasis>model.g</emphasis>.
    </para>
  </example>
  
  <example><info><title>Return the name of the current database file.</title></info>
    
    <para>
      <prompt>mged&gt;</prompt><userinput>opendb</userinput>
    </para>
    <para>Returns the name of the current database file.
    </para>
  </example>

  <example><info><title>Open and upgrade a binary-incompatible v4 file.</title></info>
    
    <para>
      <prompt>mged&gt;</prompt><userinput>opendb -f model.g</userinput>
      <prompt>mged&gt;</prompt><userinput>dbupgrade</userinput>
    </para>
    <para>Closes any currently open database and
      opens <emphasis>model.g</emphasis> as a binary-incompatible v4
      geometry database.
    </para>
  </example>

</refsection>

<info><corpauthor>BRL-CAD Team</corpauthor></info>

<refsection xml:id="bug_reports"><info><title>BUG REPORTS</title></info>
  
  <para>
    Reports of bugs or problems should be submitted via electronic
    mail to &lt;devs@brlcad.org&gt;, or via the "cadbug.sh" script.
  </para>
</refsection>
</refentry>
