How to add Name to a shape

We can use Handle(XCAFDoc_ShapeTool) and Handle(TDataStd_Name) to read a name of shape from doc,

but how to add a name to a shape? or add an Attribute to a shape? 

Hugues Delorme's picture

Hello,

    Provided you have a TDF_Label that points to the shape, you can use TDataStd_Name::Set() for this.

weiguibai_144554's picture

Thank you,I have completed it by your method!

魏涛 魏's picture

Hi:

 if I add a name to shape(like face) use TDataStd_Name::Set()  ,and then how to write to STEP file.

Entity Names can be attached to every Geometric Entity.   Why I can't?

Hope to help me, thanks.