Ok, I have the solution now.
Here I give you an example:
1 Open Abaqus CAE
2 Start recording a macro (better to work always in a work directory, check in internet how to change scarthc directory)
the macro will be recorded in abaqusmacros.py or so, in your work directory.
3 open your abaqusmacros.py and copy it in a new file for example: myscript.py
4 edit it in the next way:
eliminate all macros unless the one you want to execute, do no t eliminate the first 3 or so lines.
eliminate the first line of the macro (title)
unindent the rest of commands
save it (myscript.py)
5 if you want you can run this script from the CAE window or from the dos:
abaqus cae script=macro_cae_prueba.py
here it is the example of how it should appear:
Myscript.py:--------------------------------------------------------------------------------
# Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
import __main__
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
o1 = session.openOdb(name='C:/Datos/Abaqus_work_dir/cae_prueba.odb')
session.viewports['Viewport: 1'].setValues(displayedObject=o1)
odb = session.odbs['C:/Datos/Abaqus_work_dir/cae_prueba.odb']
session.xyDataListFromField(odb=odb, outputPosition=INTEGRATION_POINT,
variable=(('SF', INTEGRATION_POINT), ), elementSets=('SET_SALIDA', ))
x0 = session.xyDataObjects['SF:SF1 PI: PART-1-1 E: 2 IP: 1']
x1 = session.xyDataObjects['SF:SF2 PI: PART-1-1 E: 2 IP: 1']
x2 = session.xyDataObjects['SF:SF3 PI: PART-1-1 E: 2 IP: 1']
session.writeXYReport(fileName='Reporte_prueba.rpt', appendMode=OFF, xyData=(
x0, x1, x2))
-----------------------------------------------------------------------------------------------