Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

addData python function

Status
Not open for further replies.

dezsit

Mechanical
Joined
Dec 27, 2008
Messages
8
Location
HU
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
 
Hi,

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
 
Hello,

thank you for your help, it works fine!

dezsit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top