addData python function
addData python function
(OP)
Hello,
I'm working on a python script and would like to use the addData method to visualize my data.
My data come from some calculation on the stress tensor of every element and I would like to visualize the results of these elements.
I've used this formula:
R1_out = frame1.FieldOutput(name='R', description='Stress Ratio', type=SCALAR)
R1_out.addData(position=INTEGRATION_POINT, instance=instance1, labels=elLab, data=R1)
where elLab contains the element labels (type of it is list)
and R1 contains the scalar data values for each element label (type of it is also a list)
R1_out is the new field.
I always get the error message:
"OdbError: illegal argument type for built-in operation
What can be the problem?
Thank you for your help
Dezsit
I'm working on a python script and would like to use the addData method to visualize my data.
My data come from some calculation on the stress tensor of every element and I would like to visualize the results of these elements.
I've used this formula:
R1_out = frame1.FieldOutput(name='R', description='Stress Ratio', type=SCALAR)
R1_out.addData(position=INTEGRATION_POINT, instance=instance1, labels=elLab, data=R1)
where elLab contains the element labels (type of it is list)
and R1 contains the scalar data values for each element label (type of it is also a list)
R1_out is the new field.
I always get the error message:
"OdbError: illegal argument type for built-in operation
What can be the problem?
Thank you for your help
Dezsit





RE: addData python function
Please check do you have correct data format for R1. AddData constructor requires sequence of sequence.
In this case when you have list of new scalar values in format (1.0, 2.0, 3.0) you have only sequence of floats.
Each element of sequence (list or tuple) have to be also sequence. For scalar values it is one element sequence.
Example of tuple with one element tuples: ((1.0,),(2.0,),(3.0,)).
Regards
akaBarten
RE: addData python function
thank you for your help, it works fine!
dezsit