×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

addData python function

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
 

RE: addData python function

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

RE: addData python function

(OP)
Hello,

thank you for your help, it works fine!

dezsit

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources