#7 How/What can I import into the .g file

release 7.6
Modeling (11)
Lee Butler

From: Barber, Elizabeth
Sent: Wednesday, February 08, 2006 12:40 PM
Cc: Loman, David; Enderlein, Michael ; Young, Rebecca
Subject: RE: MGED import/export cmds

Quick question: Do files being imported/exported into
a .g file have to be in .txt format? Will it accept
PowerPoint (.ppt), Word (.doc), Excel (.xls), etc.?

From: Loman, David
Sent: Wednesday, February 08, 2006 12:13 PM
Subject: MGED import/export cmds
Fiddled around and figured it out:

-To Import a file into the .g file:

db binary -i u c ObjectInGeomFile.s File.txt

In case you want to know:
-i is the 'import' flag
u is the 'Major Type' (dunno what that means)
c is the datatype and c = 8bit signed char

-To export a file from the .g file:

db binary -o File.txt ObjectInGeomFile.s

I haven't played with im/exporting anything other than
a simple .txt so i cannot vouch for the data integrity
of doing this is, say, a .ppt or .doc.

Any questions, um, ask me I guess, but you could cut
to the chase and ask Lee :)



  • Lee Butler

    Lee Butler - 2006-02-08

    Logged In: YES

    If you just want to stash data in the .g file as “opaque
    binary objects” instead of geometry, then it doesn’t matter
    what form the data is in. We just stash the data. The
    recommended technique is:

    mged> dbbinary –i u c OBJECT_NAME filename

    The –i specifies import (vs. export) and u c specifies that
    the object to be created is (u)niform (c)haracter data. It
    creates an object in the database called "OBJECT_NAME" for
    you. You can get it back out via:

    mged> dbbinary -o filename OBJECT_NAME


  • Lee Butler

    Lee Butler - 2006-02-08
    • priority: 5 --> 9
    • status: open --> closed-fixed

Log in to post a comment.