Hello @WCrihfield,
Funny enough, this is the same code I was using. The only thing I didn't do was creating some geometries inside the sketch. The code was then executed with no exceptions but also with no vivible results. Here with your code, the sketch is indeed created with the geometry. But inside the browser tree nothing happens (there is no sketch item) :

I don't know why it is like this. When making the process with the mouse we get a different result. It creates some sort of intermediate adaptative workplane that guess whould humm..serve as reverse proxy I guess.

I tried achieving this by code by adding a workplane inside the part using the reference with no result. The browser tree would be correct but no adapativity between the work two work plabnes.
SO I juste brute force it like an animal and use the command manager :
Dim assyDoc As Inventor.AssemblyDocument = ThisApplication.ActiveDocument
Dim acd As Inventor.AssemblyComponentDefinition = assyDoc.ComponentDefinition
Dim refWp As Inventor.WorkPlane = acd.WorkPlanes.Item(4)
Dim targetOcc As Inventor.ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "")
targetOcc.Edit
assyDoc.SelectSet.Clear
assyDoc.SelectSet.Select(refWp)
ThisApplication.CommandManager.ControlDefinitions.Item("AppSketch2DWrapperCmd").Execute
targetOcc.ExitEdit(ExitTypeEnum.kExitToTop)
Dim pcd As Inventor.PartComponentDefinition = targetOcc.Definition
Dim sk As Inventor.PlanarSketch = pcd.Sketches.Item(1)
Dim p As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(0,0)
Dim s As SketchCircle = sk.SketchCircles.AddByCenterRadius(p, 3)
I would have prefered your solution but I guess having a sketch that you can't turn back on once made invisible might be a problem. I also tried various things like rebuilds, close & open documents back. Nothing seems to do it. Just out of curiosity, is it the same in your app? If not, what version are you using?
Thanks for your help still.
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"@LinkedIn @JohnCockerill