VII.2.3.3 Spreadsheet “ClaDbIds”
This is the spreadsheet that manages the access to the COM server and the ClaDb composite
database used for calculations. This is the first spreadsheet in which you have to go to start the
application.
The spreadsheet contains several buttons, and information on the entities available in the current
dataBase appear in the cells: lists of materials, laminates and loads. Each entity in the current dataBase
is characterized by:
- An integer ID,
- A String ID,
- an excel ID.
The integer and string id correspond to the CLA idfier of the entity. The excel ID is a String representation
of this idfier that allows to refer to the entities in the other spreadsheets. The spreadsheet defines
several buttons:
- The ComboBox button allows to select the type of file from which a DataBase shall be
read or DataBase entities shall be imported. This file format must be correctly defined
for the file read/import operations to work properly. Four file formats are possible:
“ESAComp" EDF file, FeResPost neutral data file (NDF), Nastran BDF bulk data file,
and Samcef DAT banque file.
- The “Read Data File” button is used to read a new ClaDb database. All the entities stored
in the current dataBase are first deleted. Note that the ComboBox button must have been
properly set before reading entities.
- The “Import Data File” button performs the same operation, but the entities that have
been read are added to the current dataBase. (They also replace the old entities that have
the same ID.)
- Three command buttons perform the same operation as “Import Data File” button except
that each time, only one type of entities is read: “Import Laminates”, “Import Materials”
and “Import Loads” buttons.
- The button “Save FeResPost NDF file” is used to save the composite DataBase in a
neutral data file. (Only neutral Data files can be saved by FeResPost.)
- The button “Show/Hide FeResPost” is used to show or hide the FeResPost server
window. Note that the FeResPost server continues to run, even when it is hidden.
- The button “Close FeResPost” really closes the FeResPost server. When this is done, the
composite dataBase is closed too, but its content is not saved! (so be careful with this
button.)
- The button “Delete Selected Entities” is used to remove entities from the composite
dataBase. To use this button you must first select a range in the entities that appear below,
then press the button. To select a range, at least the three columns corresponding to the
entities you want to remove must be selected.
- The two buttons “SaveDbToNeutralLines” and "RetrieveDbFromNeutralLines” are used
to store the current DataBase into the hidden “NeutralLines” spreadsheet. This allows
you to recover the db you wore working with the last time you used the workbook without
reading an NDF file. (Of course you have to save the excel workbook before quitting.)
Several macros are defined in the spreadsheet. Most of these macros perform the different operations done
by the buttons. You can access to the macros by the VBA editor. At the beginning of VBA program
lines, several variables are defined:
Dim frpApp As Variant
Dim db As Variant
Dim maxEntitiesNbr As Long
Const maxPliesNbr As Long = 100
Const appName As String = "FeResPost_3_4_0.Application"
Const logFileName As String = "FeResPost_LaminateAnalysis.log"
frpApp is the variable that contains a reference to the FeResPost COM server. db contains the
ClaDb composite dataBase in which all composite entities are stored. Only one ClaDb dataBase can
be opened in the workbook. The variable “appName” is a constant that corresponds to the
name of the server. You will have to change this variable when you change the version of
FeResPost.
The logFileName variable is used to redirect FeResPost output messages. This is necessary, as
with excel, FeResPost is not run in console mode. Practically, the redirection is programmed as
follows in “getApplication” method:
fullLogName = ActiveWorkbook.Path + "' " + logFileName
frpApp.openMsgOutputFile fullLogName, "w+"
frpApp.writeAboutInformation