Subject: RE : export attributes in ascii files
From: Christophe LE PAGE (christophe.l@chula.ac.th)
Date: Tue Nov 15 2005 - 08:18:38 CET
Bonjour Christophe,
To use the methods you are talking about (in the protocol "Util_files" of
class CormasModel), you first have to check that "theObjects" is not nil
neither empty, as these methods are using the read-accessors "theXXXs" to
access the collections of instances of class XXX.
Then, if this is ok, you can try:
self saveAttributes: #('id' 'patchID' 'visualState')
fromClass: XXX
inFile: 'test.txt'
separator: $;
It should create a file named 'test.txt' within the 'data' subdirectory of
your model, first line is the list of attributes names with their types
between brackets, then one line lists the values of the requested attributes
for one instance.
Bonne chance !
clp
-----Message d'origine-----
De : owner-cormas@cirad.fr [mailto:owner-cormas@cirad.fr] De la part de
Christophe Viavattene
Envoyé : mercredi 2 novembre 2005 20:23
À : cormas@cirad.fr
Objet : export attributes in ascii files
Dear all,
I would like to export the attributes of the passiv objects in order to use
them in a GIS software. For that I need at each step of the simulation to
generate an ascii files with the id of each object and the attributes. Do
you
know a method to do it ? I have tried with the methods present in the
instance Util_files but I have got always error messages.
Thanks,
-- Viavattene Christophe Ecole des Mines de Paris Centre d'Informatique Géologique 35, rue Saint Honoré 77305 FONTAINEBLEAU Cedex Tel. : 01 64 69 49 15