Skip to main content

DPF Framework 2026 R1

utility:data sources get attribute

Last update: 31.07.2026

Version: 0.0.0

Description

A DataSources in pin 0 and a property name (string) in pin 1 are expected in input. An index refering to the property can also be provided.

Inputs

This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation. Some inputs are required, while others are optional and provide additional configuration. Each parameter is detailed in the sections that follow the table.

Pin number Name Status Expected type(s)
0 data_sources Required data_sources
1 property_name Required string
2 property_index int32
3 property_key string
4 property_result_key string

data_sources (Pin 0)

property_name (Pin 1)

  • Required: Yes
  • Expected type(s): string

Accepted inputs are: 'file_path' (returns string), 'result_file_name' (returns string), 'domain_file_path' (returns string), 'domain_result_file_name' (returns string), 'num_keys' (returns int), num_result_key (returns int), num_file_path (returns int), 'num_result_file_path' (returns int), 'key_by_index' (returns string), 'result_key_by_index' (returns string), 'path_by_index' (returns string), 'path_key_by_index' (returns string).

property_index (Pin 2)

  • Required: No
  • Expected type(s): int32

Index for the property. Must be set for 'domain_file_path', 'domain_result_file_name' 'key_by_index', 'result_key_by_index', 'path_by_index' and 'path_key_by_index' properties.

property_key (Pin 3)

  • Required: No
  • Expected type(s): string

Key to look for. Must be set for 'file_path' and 'domain_file_path' properties.

property_result_key (Pin 4)

  • Required: No
  • Expected type(s): string

Result key to look for. Can be used for 'file_path', 'result_file_name', 'domain_file_path' and 'domain_result_file_name'.

Outputs

This table lists the output pins for this operator. Output pins provide the results of the operator's computation and can be connected to inputs of other operators or retrieved for further processing. Each output is detailed in the sections that follow the table.

Pin number Name Expected type(s)
0 property string, int32

property (Pin 0)

Property value.

Configurations

This operator supports configuration options that modify its behavior.

mutex

  • Expected type(s): bool
  • Default value: false

If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.

Scripting

This operator can be accessed through scripting interfaces using these identifiers.

Category: utility

Plugin: core

Scripting name: ds_get_attribute

Full name: utility.ds_get_attribute

Internal name: datasources::get_attribute

License: None

Examples

These examples demonstrate how to use this operator in different programming environments. Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.

C++
#include "dpf_api.h"

ansys::dpf::Operator op("datasources::get_attribute"); // operator instantiation
op.connect(0, my_data_sources);
op.connect(1, my_property_name);
op.connect(2, my_property_index);
op.connect(3, my_property_key);
op.connect(4, my_property_result_key);
std::string my_property = op.getOutput<std::string>(0);
CPython
import ansys.dpf.core as dpf

op = dpf.operators.utility.ds_get_attribute() # operator instantiation
op.inputs.data_sources.connect(my_data_sources)
op.inputs.property_name.connect(my_property_name)
op.inputs.property_index.connect(my_property_index)
op.inputs.property_key.connect(my_property_key)
op.inputs.property_result_key.connect(my_property_result_key)
my_property_as_string = op.outputs.property_as_string()
IPython
import mech_dpf
import Ans.DataProcessing as dpf

op = dpf.operators.utility.ds_get_attribute() # operator instantiation
op.inputs.data_sources.Connect(my_data_sources)
op.inputs.property_name.Connect(my_property_name)
op.inputs.property_index.Connect(my_property_index)
op.inputs.property_key.Connect(my_property_key)
op.inputs.property_result_key.Connect(my_property_result_key)
my_property = op.outputs.property.GetData()

Changelog

  • Version 0.0.0: Initial release.

Connect with Ansys