Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First we need to do in this function is to call some initialization procedures:


To open the file for writtingwriting:
customlib::InitWriteFile $filename


To initialize the material's database, indicating wich which 'conditions' have materials assigned.
customlib::InitMaterials [list "Shells"] active

...


It is time to write the point weights. To get the number of nodes where we are applying the weights, we need to specify which is the condition we are writtingwriting, and call GetNumberOfNodes:
set condition_list [list "Point_Weight"]
set number_of_conditions [customlib::GetNumberOfNodes $condition_list]


And foreach node with a Point_Weight condition asignedassigned, we need to print the node id and the asigned assigned weight.
set condition_list [list "Point_Weight"]
set condition_formats [list {"%1d" "node" "id"} {"%13.5e" "property" "Weight"}]
customlib::WriteNodes $condition_list $condition_formats


Finally, all we need to do is to close the writting writing file
customlib::EndWriteFile


To test this on your example, you just need to Save your model (ctrl + s), Mesh it (ctrl + g), and calculate (F5). You can see the result of the writting writing process opening the file {modelname}.dat on the model folder.

...