@mirkomaga
I have created C# code for the same and it's working fine for me. See attached images.


Here is the C# code. It's console Application code. And note that Inventor application as well as Part is open when you test it.
Inventor.Application inventorApplication = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
PartDocument partDocument = (PartDocument)inventorApplication.ActiveDocument;
PartComponentDefinition partComponentDefinition =partDocument.ComponentDefinition;
foreach (PartFeature partfeature in partComponentDefinition.Features)
{
if (partfeature.Type == ObjectTypeEnum.kHoleFeatureObject)
{
HoleFeature holeFeature = (HoleFeature)partfeature;
Console.WriteLine(holeFeature.Sketch.Name);
}
}
Regards,
Jatin Devaiya
Accept it as solution.
Regards,
Jatin Devaiya
If a response answers your question, please use ACCEPT SOLUTION to assist other users later.
Also be generous with Likes! Thank you and enjoy!