- How I could print in the calc file the number of the layer which an element belongs to?
Now, it is available inside the bas file the layer information: *ElemsLayerNum *NodesLayerNum, *Loop Layers, *LayerNum, *LayerName, *LayerColorRGB, etc
In old versions, the layers information cannot be directly dumped into the output file. Tipicallly, it is necessary to assign a material or a condition to the elements that reflects this property. There are bassically two options:
- User assigns a condition or material to the elements with a field that reflects the property that you are working with.
- Perform the last step automatically.
To do it automatically use the following:
TCL function 'BeforeWriteCalcFileGIDProject', is executed just before writing the calculations file. You can define this function in your 'problemtype'.tcl file and make it assign a condition to the entities depending on the layers.
TCL function 'AfterWriteCalcFileGIDProject' is executed just after writing the calculations file. You can clean up this condition if you wish.
TCL command '.central.s info layers' gives you the layers of the project.
TCL command '.central.s info layers -entities Elements' returns the elements belonging to a layer.
.central.s process escape escape data conditions assign cond CND change VALUE layer:LAYER1
would assign to condition CND with value VALUE all the entities belonging to layer LAYER1.