Python Result and DPF - how to select component

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

Using DPF to retrieve the deformation on a model. The operator returns a fields container with 3 components (UX, UY, UZ). How can I select the component to be plotted, in case I want to plot only UX for example ?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

    Use the component_selector operator:

    deformation_component = dpf.operators.logic.component_selector()
    deformation_component .inputs.field.Connect(deformation)
    deformation_component .inputs.component_number.Connect(0)