    

 ## On this page

  

 

 # ansys::dpf::DataTree Class Reference

 Last update: 16.07.2025 

`#include <dpf_api.h>`

Inheritance diagram for ansys::dpf::DataTree:

 ![](/sites/default/files/migrate-content/dpf_cpp_client_library_2025_r2_new_link_to_op_1/classansys_1_1dpf_1_1DataTree.png)



## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [DataTree](classansys_1_1dpf_1_1DataTree.xhtml#a1c47166bd00e9a3168a9f045f6de1e0e) ([Client](classansys_1_1dpf_1_1Client.xhtml) const \*const client) <a id="a45794f55475843de36a620e6bf8a24a6" name="a45794f55475843de36a620e6bf8a24a6"></a> **DataTree** ([DataTree](classansys_1_1dpf_1_1DataTree.xhtml) const &amp;) <a id="ac1f6ad1c7025ca6ac20082a530e9dd06" name="ac1f6ad1c7025ca6ac20082a530e9dd06"></a> **DataTree** ([DataTree](classansys_1_1dpf_1_1DataTree.xhtml) &amp;&amp;) noexcept <a id="a859b20aa1351b9551e1e0cf9e6350fd1" name="a859b20aa1351b9551e1e0cf9e6350fd1"></a>[DataTree](classansys_1_1dpf_1_1DataTree.xhtml) &amp; **operator=** ([DataTree](classansys_1_1dpf_1_1DataTree.xhtml) const &amp;) <a id="afda6bb8faac2ce7a833928bd0a740739" name="afda6bb8faac2ce7a833928bd0a740739"></a>[DataTree](classansys_1_1dpf_1_1DataTree.xhtml) &amp; **operator=** ([DataTree](classansys_1_1dpf_1_1DataTree.xhtml) &amp;&amp;) noexcept void [fillFromJson](classansys_1_1dpf_1_1DataTree.xhtml#a3772c0ff3572c7f84c4c05502e425d08) (std::istream const &amp;stream) const void [fillFromTxt](classansys_1_1dpf_1_1DataTree.xhtml#a64415f0ebdf85080a7c413edc24114d2) (std::istream const &amp;stream) const void [writeToTxt](classansys_1_1dpf_1_1DataTree.xhtml#a2f6cbbcca9c04de9a5d1821ab1f85d38) (std::ostream &amp;stream) const void [writeToJson](classansys_1_1dpf_1_1DataTree.xhtml#a3fc23d000373acf82b7be9d9689ff957) (std::ostream &amp;stream) const std::vector&lt; std::string &gt; [getAvailableAttributeNames](classansys_1_1dpf_1_1DataTree.xhtml#a387ca479f3cfbc9108525f61b7572302) () const std::vector&lt; std::string &gt; [getAvailableSubTreeNames](classansys_1_1dpf_1_1DataTree.xhtml#a2cf094e8fce213c47869123396bac585) () const const [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) [getSubByName](classansys_1_1dpf_1_1DataTree.xhtml#a5c2cf876663f094d2fd3f54c7975a111) (std::string const &amp;name) const int [getIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#aafba734273a1af1c2fd85194e05231c1) (std::string const &amp;name, int default\_value=0) const bool [tryGetIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a3e62c3b70df697e040677884529f501e) (std::string const &amp;name, int &amp;value) const Get an attribute by its name. [More...](classansys_1_1dpf_1_1DataTree.xhtml#a3e62c3b70df697e040677884529f501e)  
 bool [getBoolAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a41c18162d9ba5e12d81b2a5f85d7466d) (std::string const &amp;name, bool default\_value=false) const bool [tryGetBoolAttribute](classansys_1_1dpf_1_1DataTree.xhtml#adbd30bd4c40e71abe1cbecf49023c0ab) (std::string const &amp;name, bool &amp;value) const Get an attribute by its name. [More...](classansys_1_1dpf_1_1DataTree.xhtml#adbd30bd4c40e71abe1cbecf49023c0ab)  
 unsigned int [getUnsignedIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a76fe3c29a72f34c67b8f3579df025dd4) (std::string const &amp;name, unsigned int default\_value=0) const bool [tryGetUnsignedIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a682e61166e908af29bfca74d9c2c0aa6) (std::string const &amp;name, unsigned int &amp;value) const double [getDoubleAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a266762d4a1dfcd0a6f939a4107226fca) (std::string const &amp;name, double default\_value=0.0) const bool [tryGetDoubleAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a4cc6693778f3db06b93e51a398c3e716) (std::string const &amp;name, double &amp;value) const std::string [getStringAttribute](classansys_1_1dpf_1_1DataTree.xhtml#ab465ed6523a35c0ebc9483252aea6840) (std::string const &amp;name, std::string="") const bool [tryGetStringAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a15e1d291c77b1220d1a1df12320e2aa7) (std::string const &amp;name, std::string &amp;value) const std::vector&lt; int &gt; [getVectIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#ae5e9c8f83518bcb2435e9b5244c7e456) (std::string const &amp;name, std::vector&lt; int &gt; default\_value={}) const bool [tryGetVectIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#ac81aeefaca719783f1b79e41dc5a3e68) (std::string const &amp;name, std::vector&lt; int &gt; &amp;value) const std::vector&lt; double &gt; [getVectDoubleAttribute](classansys_1_1dpf_1_1DataTree.xhtml#acf243a39659235e13f99dc528ee231e4) (std::string const &amp;name, std::vector&lt; double &gt; default\_value={}) const bool [tryGetVectDoubleAttribute](classansys_1_1dpf_1_1DataTree.xhtml#ae9e204844851300d1613bf1fc8ed33fc) (std::string const &amp;name, std::vector&lt; double &gt; &amp;value) const std::vector&lt; std::string &gt; [getVectStringAttribute](classansys_1_1dpf_1_1DataTree.xhtml#af681fa5a409b85b8015af80b8d0f3bf5) (std::string const &amp;name, std::vector&lt; std::string &gt; default\_value={}) const bool [tryGetVectStringAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a677df71a1a093b48bdad8dccf575ce15) (std::string const &amp;name, std::vector&lt; std::string &gt; &amp;value) const void [makeIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a00f7067a548e3ca2dc21ac63bf1f4e13) (std::string const &amp;name, int value) void [makeBoolAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a12d088c2d4aecb4d7ad4e28b400cd9c1) (std::string const &amp;name, bool value) void [makeUnsignedIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#ae4120d3564517f8481feddb749940e32) (std::string const &amp;name, unsigned int value) void [makeDoubleAttribute](classansys_1_1dpf_1_1DataTree.xhtml#aa2d8b58119590de684d399072435b565) (std::string const &amp;name, double value) void [makeStringAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a82714e5e01a67de376d2e0e53bb1e126) (std::string const &amp;name, std::string const &amp;value) void [makeVectIntAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a40c87dbd75b43d54a01f6a2326952a50) (std::string const &amp;name, std::vector&lt; int &gt; const &amp;value) void [makeVectDoubleAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a13ea47ce80b84b62943ae7048d119484) (std::string const &amp;name, std::vector&lt; double &gt; const &amp;value) void [makeVectStringAttribute](classansys_1_1dpf_1_1DataTree.xhtml#aa03b920ab02e60829acc9587f9bf51fc) (std::string const &amp;name, std::vector&lt; std::string &gt; const &amp;value) [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) [makeSub](classansys_1_1dpf_1_1DataTree.xhtml#aa18973ec995c9088d1d6abb65c7660ff) (std::string const &amp;name) <a id="a09a963609da9eb0092bf1d8658def177" name="a09a963609da9eb0092bf1d8658def177"></a>void **makeSubTreeAttribute** (std::string const &amp;name, [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) const \*const sub\_tree) bool [hasAttribute](classansys_1_1dpf_1_1DataTree.xhtml#a3422a0cbc6d69c9dd91ea7a5cb5869bb) (std::string const &amp;attribute\_name) const bool [hasSub](classansys_1_1dpf_1_1DataTree.xhtml#a6d1859fee7564672cbf1a85d9d8bb492) (std::string const &amp;attribute\_name) const ![-](/sites/default/files/migrate-content/dpf_cpp_client_library_2025_r2_new_link_to_op_1/closed.png) Public Member Functions inherited from [ansys::dpf::DpfTypes](classansys_1_1dpf_1_1DpfTypes.xhtml)virtual bool [empty](classansys_1_1dpf_1_1DpfTypes.xhtml#a39cd546c42518e2332be8f287db95459) () const virtual bool [hasInternalObject](classansys_1_1dpf_1_1DpfTypes.xhtml#ae198f89868d85c7db6dc1a934a1d3c15) () const virtual std::string [describe](classansys_1_1dpf_1_1DpfTypes.xhtml#a9977945710983bc03d2940fa007847b2) () const so::API const \* [callAPI](classansys_1_1dpf_1_1DpfTypes.xhtml#aea34d37e0c080126eff70db34bf46597) () const bool [isOnCommonAPI](classansys_1_1dpf_1_1DpfTypes.xhtml#a9f9789ff61cc9d400a2a344830706b73) () const bool [getClient](classansys_1_1dpf_1_1DpfTypes.xhtml#a968afd9daa0b0f13b65a2ac61369d73a) ([Client](classansys_1_1dpf_1_1Client.xhtml) &amp;client) const bool [hasBeenMovedLocally](classansys_1_1dpf_1_1DpfTypes.xhtml#a1a5634202c15404b6b24e8f50e51cb66) () const bool [isSameObject](classansys_1_1dpf_1_1DpfTypes.xhtml#aa64d5f8fcd7d85ad6ebf708494dbefd7) ([DpfTypes](classansys_1_1dpf_1_1DpfTypes.xhtml) const &amp;rhs) const ## <a id="pub-static-methods" name="pub-static-methods"></a>Static Public Member Functions

static [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) [emptyDataTree](classansys_1_1dpf_1_1DataTree.xhtml#afb0171dc88164d841e4d8d1d14c8dc92) () <a id="details" name="details"></a>## Detailed Description

Define a DOM (Document-Object-Model) tree.



## Constructor &amp; Destructor Documentation

<a id="a1c47166bd00e9a3168a9f045f6de1e0e" name="a1c47166bd00e9a3168a9f045f6de1e0e"></a>## [◆ ](#a1c47166bd00e9a3168a9f045f6de1e0e)DataTree()

 ansys::dpf::DataTree::DataTree  ( [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const  *client*) 

Parameters \[in\]client[Client](classansys_1_1dpf_1_1Client.xhtml) instance designating the IP, port and protocol to use. 



## Member Function Documentation

<a id="afb0171dc88164d841e4d8d1d14c8dc92" name="afb0171dc88164d841e4d8d1d14c8dc92"></a>## [◆ ](#afb0171dc88164d841e4d8d1d14c8dc92)emptyDataTree()

 static [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) ansys::dpf::DataTree::emptyDataTree  ( )   static 

Create an empty [DataTree](classansys_1_1dpf_1_1DataTree.xhtml).

ReturnsEmpty [DataTree](classansys_1_1dpf_1_1DataTree.xhtml). 



<a id="a3772c0ff3572c7f84c4c05502e425d08" name="a3772c0ff3572c7f84c4c05502e425d08"></a>## [◆ ](#a3772c0ff3572c7f84c4c05502e425d08)fillFromJson()

 void ansys::dpf::DataTree::fillFromJson  ( std::istream const &amp;  *stream*)  const

Fill this data tree with the content of a json file generated by another tree (See [DataTree::writeToJson](classansys_1_1dpf_1_1DataTree.xhtml#a3fc23d000373acf82b7be9d9689ff957)).





<a id="a64415f0ebdf85080a7c413edc24114d2" name="a64415f0ebdf85080a7c413edc24114d2"></a>## [◆ ](#a64415f0ebdf85080a7c413edc24114d2)fillFromTxt()

 void ansys::dpf::DataTree::fillFromTxt  ( std::istream const &amp;  *stream*)  const

Fill this data tree with the content of a txt file generated by another tree (See [DataTree::writeToTxt](classansys_1_1dpf_1_1DataTree.xhtml#a2f6cbbcca9c04de9a5d1821ab1f85d38)).





<a id="a387ca479f3cfbc9108525f61b7572302" name="a387ca479f3cfbc9108525f61b7572302"></a>## [◆ ](#a387ca479f3cfbc9108525f61b7572302)getAvailableAttributeNames()

 std::vector&lt; std::string &gt; ansys::dpf::DataTree::getAvailableAttributeNames  ( )  const

Returnsthe list of attributes names available (without recursivity in the subtrees). 



<a id="a2cf094e8fce213c47869123396bac585" name="a2cf094e8fce213c47869123396bac585"></a>## [◆ ](#a2cf094e8fce213c47869123396bac585)getAvailableSubTreeNames()

 std::vector&lt; std::string &gt; ansys::dpf::DataTree::getAvailableSubTreeNames  ( )  const

Returnsthe list of first rank substree names available (without recursivity in the subtrees). 



<a id="a41c18162d9ba5e12d81b2a5f85d7466d" name="a41c18162d9ba5e12d81b2a5f85d7466d"></a>## [◆ ](#a41c18162d9ba5e12d81b2a5f85d7466d)getBoolAttribute()

 bool ansys::dpf::DataTree::getBoolAttribute  ( std::string const &amp;  *name*,    bool  *default\_value* = `false`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="a266762d4a1dfcd0a6f939a4107226fca" name="a266762d4a1dfcd0a6f939a4107226fca"></a>## [◆ ](#a266762d4a1dfcd0a6f939a4107226fca)getDoubleAttribute()

 double ansys::dpf::DataTree::getDoubleAttribute  ( std::string const &amp;  *name*,    double  *default\_value* = `0.0`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="aafba734273a1af1c2fd85194e05231c1" name="aafba734273a1af1c2fd85194e05231c1"></a>## [◆ ](#aafba734273a1af1c2fd85194e05231c1)getIntAttribute()

 int ansys::dpf::DataTree::getIntAttribute  ( std::string const &amp;  *name*,    int  *default\_value* = `0`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="ab465ed6523a35c0ebc9483252aea6840" name="ab465ed6523a35c0ebc9483252aea6840"></a>## [◆ ](#ab465ed6523a35c0ebc9483252aea6840)getStringAttribute()

 std::string ansys::dpf::DataTree::getStringAttribute  ( std::string const &amp;  *name*,    std::string   = `""`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="a5c2cf876663f094d2fd3f54c7975a111" name="a5c2cf876663f094d2fd3f54c7975a111"></a>## [◆ ](#a5c2cf876663f094d2fd3f54c7975a111)getSubByName()

 const [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) ansys::dpf::DataTree::getSubByName  ( std::string const &amp;  *name*)  const

Returnsa subtree by its name (return an empty substree if it doesn't exist). 



<a id="a76fe3c29a72f34c67b8f3579df025dd4" name="a76fe3c29a72f34c67b8f3579df025dd4"></a>## [◆ ](#a76fe3c29a72f34c67b8f3579df025dd4)getUnsignedIntAttribute()

 unsigned int ansys::dpf::DataTree::getUnsignedIntAttribute  ( std::string const &amp;  *name*,    unsigned int  *default\_value* = `0`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="acf243a39659235e13f99dc528ee231e4" name="acf243a39659235e13f99dc528ee231e4"></a>## [◆ ](#acf243a39659235e13f99dc528ee231e4)getVectDoubleAttribute()

 std::vector&lt; double &gt; ansys::dpf::DataTree::getVectDoubleAttribute  ( std::string const &amp;  *name*,    std::vector&lt; double &gt;  *default\_value* = `{}`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="ae5e9c8f83518bcb2435e9b5244c7e456" name="ae5e9c8f83518bcb2435e9b5244c7e456"></a>## [◆ ](#ae5e9c8f83518bcb2435e9b5244c7e456)getVectIntAttribute()

 std::vector&lt; int &gt; ansys::dpf::DataTree::getVectIntAttribute  ( std::string const &amp;  *name*,    std::vector&lt; int &gt;  *default\_value* = `{}`   )  const

Returnsan attribute by its name Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="af681fa5a409b85b8015af80b8d0f3bf5" name="af681fa5a409b85b8015af80b8d0f3bf5"></a>## [◆ ](#af681fa5a409b85b8015af80b8d0f3bf5)getVectStringAttribute()

 std::vector&lt; std::string &gt; ansys::dpf::DataTree::getVectStringAttribute  ( std::string const &amp;  *name*,    std::vector&lt; std::string &gt;  *default\_value* = `{}`   )  const

Returnsan attribute by its name. Parameters Nameof the attribute. Defaultvalue of the attribute. @information: if the attribute doesn't exist, the default value is returned. 



<a id="a3422a0cbc6d69c9dd91ea7a5cb5869bb" name="a3422a0cbc6d69c9dd91ea7a5cb5869bb"></a>## [◆ ](#a3422a0cbc6d69c9dd91ea7a5cb5869bb)hasAttribute()

 bool ansys::dpf::DataTree::hasAttribute  ( std::string const &amp;  *attribute\_name*)  const

Returnstrue if an attribute exists (accepts sub attributes by adding "/", example attribute\_name="sub\_name/attrib\_name"). 



<a id="a6d1859fee7564672cbf1a85d9d8bb492" name="a6d1859fee7564672cbf1a85d9d8bb492"></a>## [◆ ](#a6d1859fee7564672cbf1a85d9d8bb492)hasSub()

 bool ansys::dpf::DataTree::hasSub  ( std::string const &amp;  *attribute\_name*)  const

Returnstrue if a subtree exists. 



<a id="a12d088c2d4aecb4d7ad4e28b400cd9c1" name="a12d088c2d4aecb4d7ad4e28b400cd9c1"></a>## [◆ ](#a12d088c2d4aecb4d7ad4e28b400cd9c1)makeBoolAttribute()

 void ansys::dpf::DataTree::makeBoolAttribute  ( std::string const &amp;  *name*,    bool  *value*   ) 

create or replace an attribute.





<a id="aa2d8b58119590de684d399072435b565" name="aa2d8b58119590de684d399072435b565"></a>## [◆ ](#aa2d8b58119590de684d399072435b565)makeDoubleAttribute()

 void ansys::dpf::DataTree::makeDoubleAttribute  ( std::string const &amp;  *name*,    double  *value*   ) 

create or replace an attribute.





<a id="a00f7067a548e3ca2dc21ac63bf1f4e13" name="a00f7067a548e3ca2dc21ac63bf1f4e13"></a>## [◆ ](#a00f7067a548e3ca2dc21ac63bf1f4e13)makeIntAttribute()

 void ansys::dpf::DataTree::makeIntAttribute  ( std::string const &amp;  *name*,    int  *value*   ) 

create or replace an attribute.





<a id="a82714e5e01a67de376d2e0e53bb1e126" name="a82714e5e01a67de376d2e0e53bb1e126"></a>## [◆ ](#a82714e5e01a67de376d2e0e53bb1e126)makeStringAttribute()

 void ansys::dpf::DataTree::makeStringAttribute  ( std::string const &amp;  *name*,    std::string const &amp;  *value*   ) 

create or replace an attribute.





<a id="aa18973ec995c9088d1d6abb65c7660ff" name="aa18973ec995c9088d1d6abb65c7660ff"></a>## [◆ ](#aa18973ec995c9088d1d6abb65c7660ff)makeSub()

 [DataTree](classansys_1_1dpf_1_1DataTree.xhtml) ansys::dpf::DataTree::makeSub  ( std::string const &amp;  *name*) 

create a subtree with a name. If the substree already exists, it is returned.

Returnsthe created subtree to fill it. 



<a id="ae4120d3564517f8481feddb749940e32" name="ae4120d3564517f8481feddb749940e32"></a>## [◆ ](#ae4120d3564517f8481feddb749940e32)makeUnsignedIntAttribute()

 void ansys::dpf::DataTree::makeUnsignedIntAttribute  ( std::string const &amp;  *name*,    unsigned int  *value*   ) 

create or replace an attribute.





<a id="a13ea47ce80b84b62943ae7048d119484" name="a13ea47ce80b84b62943ae7048d119484"></a>## [◆ ](#a13ea47ce80b84b62943ae7048d119484)makeVectDoubleAttribute()

 void ansys::dpf::DataTree::makeVectDoubleAttribute  ( std::string const &amp;  *name*,    std::vector&lt; double &gt; const &amp;  *value*   ) 

create or replace an attribute.





<a id="a40c87dbd75b43d54a01f6a2326952a50" name="a40c87dbd75b43d54a01f6a2326952a50"></a>## [◆ ](#a40c87dbd75b43d54a01f6a2326952a50)makeVectIntAttribute()

 void ansys::dpf::DataTree::makeVectIntAttribute  ( std::string const &amp;  *name*,    std::vector&lt; int &gt; const &amp;  *value*   ) 

create or replace an attribute.





<a id="aa03b920ab02e60829acc9587f9bf51fc" name="aa03b920ab02e60829acc9587f9bf51fc"></a>## [◆ ](#aa03b920ab02e60829acc9587f9bf51fc)makeVectStringAttribute()

 void ansys::dpf::DataTree::makeVectStringAttribute  ( std::string const &amp;  *name*,    std::vector&lt; std::string &gt; const &amp;  *value*   ) 

create or replace an attribute.





<a id="adbd30bd4c40e71abe1cbecf49023c0ab" name="adbd30bd4c40e71abe1cbecf49023c0ab"></a>## [◆ ](#adbd30bd4c40e71abe1cbecf49023c0ab)tryGetBoolAttribute()

 bool ansys::dpf::DataTree::tryGetBoolAttribute  ( std::string const &amp;  *name*,    bool &amp;  *value*   )  const

Get an attribute by its name.

Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="a4cc6693778f3db06b93e51a398c3e716" name="a4cc6693778f3db06b93e51a398c3e716"></a>## [◆ ](#a4cc6693778f3db06b93e51a398c3e716)tryGetDoubleAttribute()

 bool ansys::dpf::DataTree::tryGetDoubleAttribute  ( std::string const &amp;  *name*,    double &amp;  *value*   )  const

Returnsan attribute by its name.Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="a3e62c3b70df697e040677884529f501e" name="a3e62c3b70df697e040677884529f501e"></a>## [◆ ](#a3e62c3b70df697e040677884529f501e)tryGetIntAttribute()

 bool ansys::dpf::DataTree::tryGetIntAttribute  ( std::string const &amp;  *name*,    int &amp;  *value*   )  const

Get an attribute by its name.

Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="a15e1d291c77b1220d1a1df12320e2aa7" name="a15e1d291c77b1220d1a1df12320e2aa7"></a>## [◆ ](#a15e1d291c77b1220d1a1df12320e2aa7)tryGetStringAttribute()

 bool ansys::dpf::DataTree::tryGetStringAttribute  ( std::string const &amp;  *name*,    std::string &amp;  *value*   )  const

Returnsan attribute by its name.Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="a682e61166e908af29bfca74d9c2c0aa6" name="a682e61166e908af29bfca74d9c2c0aa6"></a>## [◆ ](#a682e61166e908af29bfca74d9c2c0aa6)tryGetUnsignedIntAttribute()

 bool ansys::dpf::DataTree::tryGetUnsignedIntAttribute  ( std::string const &amp;  *name*,    unsigned int &amp;  *value*   )  const

Returnsan attribute by its name.Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="ae9e204844851300d1613bf1fc8ed33fc" name="ae9e204844851300d1613bf1fc8ed33fc"></a>## [◆ ](#ae9e204844851300d1613bf1fc8ed33fc)tryGetVectDoubleAttribute()

 bool ansys::dpf::DataTree::tryGetVectDoubleAttribute  ( std::string const &amp;  *name*,    std::vector&lt; double &gt; &amp;  *value*   )  const

Returnsan attribute by its name.Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="ac81aeefaca719783f1b79e41dc5a3e68" name="ac81aeefaca719783f1b79e41dc5a3e68"></a>## [◆ ](#ac81aeefaca719783f1b79e41dc5a3e68)tryGetVectIntAttribute()

 bool ansys::dpf::DataTree::tryGetVectIntAttribute  ( std::string const &amp;  *name*,    std::vector&lt; int &gt; &amp;  *value*   )  const

Returnsan attribute by its name.Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="a677df71a1a093b48bdad8dccf575ce15" name="a677df71a1a093b48bdad8dccf575ce15"></a>## [◆ ](#a677df71a1a093b48bdad8dccf575ce15)tryGetVectStringAttribute()

 bool ansys::dpf::DataTree::tryGetVectStringAttribute  ( std::string const &amp;  *name*,    std::vector&lt; std::string &gt; &amp;  *value*   )  const

Returnsan attribute by its name.Available since Ansys 2025R2.

Parameters Nameof the attribute. Outputvalue of the attribute. Returnstrue if the attribute exists, false otherwise. 



<a id="a3fc23d000373acf82b7be9d9689ff957" name="a3fc23d000373acf82b7be9d9689ff957"></a>## [◆ ](#a3fc23d000373acf82b7be9d9689ff957)writeToJson()

 void ansys::dpf::DataTree::writeToJson  ( std::ostream &amp;  *stream*)  const

Write the attributes and the subtrees of this data tree in a json like format in a c++ standard output stream (example: std::ofstream, std::ostringstream).





<a id="a2f6cbbcca9c04de9a5d1821ab1f85d38" name="a2f6cbbcca9c04de9a5d1821ab1f85d38"></a>## [◆ ](#a2f6cbbcca9c04de9a5d1821ab1f85d38)writeToTxt()

 void ansys::dpf::DataTree::writeToTxt  ( std::ostream &amp;  *stream*)  const

Write the attributes and the subtrees of this data tree as text in a c++ standard output stream (example: std::ofstream, std::ostringstream).