Browse the sketches of a play in vba

Hello everyone,

I'm looking for a way to loop through all the sketches in a part file.
I can't figure out how from the current document to go through each sketch to check that it contains sketch text.

I guess that from the active document, you have to go through a collection of feature objects, and then on each function check on each child (sketch) that there is a sketch text.
This is the path that seems logical to me, but no idea how to get there.

Thank you in advance for any information you could give me.

Bonjour;
Tu trouvera un élément de réponse ici:
https://help.solidworks.com/2021/English/api/sldworksapi/Get_All_Elements_of_Sketch_Example_VB.htm
et un autre ici:
https://help.solidworks.com/2021/English/api/sldworksapi/Replace_Sketch_Text_Example_VB.htm

Et pourquoi pas: (changer le format du Texte)
https://help.solidworks.com/2022/english/api/sldworksapi/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.ISketchText~GetUseDocTextFormat.html

=> Les commande intéressantes étant (en vrac):

Dim swSkSeg  As SldWorks.SketchSegment
Dim swSketch As SldWorks.Sketch
sSkSegmentsName(swSkSeg.GetType)
....
GetSketchTextSegments

et pour parcourir le FeatureManager:

avec:

3 Likes