DPF API in C# : Error on connecting TimeFreqSupport to hdf5dpf operator

Fran.Rourke
Fran.Rourke Member Posts: 1 **

Hello,

I am using the C# DPF API to write some code which serialises mesh and operating deflection shapes results into .h5 format. I was sent a Python script by one of your colleagues which does something similar - I am able to run this script fine without problem, with my Ansys 24R1 installation.

I hit an error when running the following C# lines

The error I get is:

It seems like the hdf5dpf operator doesn't have a TimeFreqSupport that the velocities fields container can fill in? In case it is useful these are the .dlls that are being imported, along with the environment initialisation.


I don't think it's likely to be because of my Ansys 24R1 installation, seeing as I can run the same thing using the Python API fine.

Hope you can help.

Best regards,
Fran Rourke

Tagged:

Answers

  • Chris Harrold
    Chris Harrold Member, Administrator, Employee Posts: 183
    5 Answers 100 Comments Photogenic Name Dropper
    admin

    @Ramdane or @Paul Profizi can you assist here?

  • Paul Profizi
    Paul Profizi Member, Employee Posts: 11
    5 Likes 10 Comments Name Dropper Ansys Employee
    ✭✭✭
    edited June 12

    Hello @Fran.Rourke,

    I just checked, and for some reason the C# API does not currently allow connecting a TimeFreqSupport type to an operator input pin the way you are doing it.
    This is an issue I'll report, but in the meantime you can use this workaround:
    instead of
    "allFreqsOperator.inputs.time_freq_support_out.Connect(velocitiesFC.TimeFreqSupport)"
    please try
    "allFreqsOperator.Connect(2, velocitiesFC.TimeFreqSupport)"

    2 being the input pin number for the TimeFreqSupport, as declared in the documentation of the hdf5dpf_generate_result_file operator.