Selecting Sketch of Component to Cut-Extrude

Hello, I am hoping someone can point me in a direction for this question or has something similar that they could share.

My problem is:Selecting a sketch inside a component of an assembly to create a cut-extrude to a sketch plane.

  • The sketch I made a specific name for, "CutToFirstPlane". I have 3 other sketches in this specific part named something special also.
  • The component name always changes along with the assembly name. The assemblies are used for creating work holding fixtures. It is part of a template that I use and Pack N Go.

I have no problem selecting the planes using SelectByID2.

I am stuck on how to select the sketches. Can someone please help with this or point me into a direction?

I had a program working before, but for some magical reason it is not working anymore.

I used to be able to select just the component in the feature manager tree (that had the 4 specially named sketches) and run the macro after I made the adjustments to them accordingly. For the 4 sketches I was also using SelectByID2.

Example: boolstatus=swModel.Extension.SelectByID2("CutToFirstPlane@" + swComp.Name2 + "@" + swModel.GetTitle, "SKETCH" 0,0,0, True, 0, Nothing, 0)

This all of a sudden does not work anymore.

SolidworksApi/macros