Errors in reproducing the example codes in the developer forum

lottyZHANG
lottyZHANG Member Posts: 5
First Comment
**
edited September 10 in General Language Questions

Hello, I am now following this instruction (https://developer.ansys.com/blog/script-tip-friday-python-code-object-mechanical ) to use "Python Codes" for post-processing. However, I am encountered with the following errors:

failed to create drawable

failed to create drawable X

Error of failed request: BadValue (integer parameter out of range for operation)

Major opcode of failed request: 53 (X_CreatePixmap)

Value in failed request: 0x1e

Serial number of failed request: 30

Current serial number in output stream: 36

Any suggestions to correct it? Thanks a lot!

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    Hello, are you using exactly this example, and have checked all the settings ? In which version of Ansys are you having this issue ?

  • lottyZHANG
    lottyZHANG Member Posts: 5
    First Comment
    **

    I am using ANSYS 2023R2, and all the settings are configured according to the instructions provided in the example.

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    I tested on a dummy model in 2023R2 and it works fine on my end:

    See attached. Please test it on your end and keep me posted.
    Are you successful in running the Python Code object in Mechanical instead of running the DoE solve from WB ?

  • lottyZHANG
    lottyZHANG Member Posts: 5
    First Comment
    **


    This is how I use Python codes. These are my codes:

    (This is the second module, following an earlier thermal analysis I conducted.)

  • lottyZHANG
    lottyZHANG Member Posts: 5
    First Comment
    **


    Sorry, this is the screenshot for the codes.

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    Please confirm whether the dummy model I sent you runs on your end or not.
    In your model, please check that the code runs when run from the console and not from a Python Code object. There probably is something speficic to your model that makes the code fail.