Orca3D News

Tuesday, April 9, 2013

Recovering Weight & Cost Library Data from a Model

We recently had a support request from a user who had lost their Orca3D Weight & Cost Material Library due to a hard disk crash, but they still had a model (3dm file) that contained many of the materials. The question was whether the material properties in the model file could be used to rebuild the Material Library. The answer is "yes," and the steps to do so are described below.

First, it's worth explaining the relationship between the material properties that Orca3D maintains in the model file and those in the Material Library. When a model is read into Rhino, Orca3D compares the materials used in the model file to those in the library. If there is a match, the properties from the library are used. This is so that if you have modified the data in your library (changed the weight density, for example) your design will reflect the updated data. A match is determined by a unique identifier (UUID) that is maintained for each property, not by the name of the material.

If a match is not found for a material, then the properties which are stored in the 3dm file are used, and they become static (i.e., they cannot be changed). An advantage of this system is that if you send your model to another Orca3D user, the materials in your model will not be changed by the values in the other user's library, even if there are materials of the same name.

So, you find yourself with a 3dm file that contains Orca3D materials that you'd like to add to your library, either because your library was lost (e.g., in a hard disk crash), or you received a model from someone else with some useful material data in it. These are the steps to follow. Don't be intimidated by the number and detail of the steps; it's really quite simple.
  1. Open the model in Rhino, and generate an Orca3D weight report using all objects.
  2. From the weight report, export to an Excel file using the ReportViewer's built in export capability.
  3. Copy sheet 3 of that export to a new Excel workbook.
  4. The data in this new workbook must be edited to match the format required to import it into the Orca3D Material Library. The easiest way to do this is to export the current Material Library from Orca3D (you will probably want to make sure you have at least one material of each type in your Material Library before exporting, even if they are "dummy" materials, just so you have something in the export to use as a reference):
    • In Rhino, in the Orca3D menu, select Weight/Cost -> Export Material Library
    • In the Save As dialog, set the "Save as type" to CSV files, and save the file
  5. Copy the data from the new workbook created in Step 3 into the CSV file created in Step 4, formatting it to match the data in the CSV file. Be careful not to inadvertently modify any of the existing materials in the file or these changes will be reflected in your library after merging the file. Note the header information containing units, which shows the conversion to SI from the unit system that your data is in. Your data should be entered in the second unit shown (e.g., if it says "m^2 per ft^2," your data should be in ft^2 for surfaces). Also note the column labeled Material UUID. This column must be there, although you don't need to enter any information in it. In the Material Type column, allowable values are "point," "curve," "surface," or "solid." This format is rigid, but should be easy to follow. Save this as a CSV file.
  6. In Rhino, in the Orca3D menu, select Weight/Cost -> Merge Material Library and select the new CSV file.
  7. The original data that was exported into the CSV file, as well as the new information that you entered, will now be part of your Material Library. During the import, any items without UUID's will be assigned one. Note that the materials used in your model are still static; if you wish to associate them with the new entries in the Material Library, you must do that manually.
If you have any problems with the procedure, you can send us the 3dm file, and we can do the conversion for you.

Finally, if you ever want to back up your Orca3D Material Library, look for the file "StockMaterialLibrary.xml." In Windows 7 and later, it will be in c:\ProgramData\DRSC3ATC\Orca3D. In Windows XP and earlier it will be in  C:\Documents and Settings\All Users\Application Data\DRSC3ATC\Orca3D. You'll see some other files here worth backing up as well, including your hull assistant definitions, in the file Orca3DHullAssistants.xml, and stability criteria (Orca3DStabilityCriteria.xml).