Can you clarify your question a little bit? I’m not sure what you are asking.
But I can provide a bit more explanation about ModelGeometry, with a perhaps overly simplified explanation of what it happening. In this routine you’re dealing with different types of entities: Curves and Edges. The drawing view is like a screen where the model is projected upon. The drawing shows lines and arcs but in fact the drawing is flat and 2D. The lines that are on this 2D drawing are called Curves. In the 3D world of your model, the model has Edges. The Edges are projected on the drawing view to make the curves.
In this routine, your mouse is moving over a drawing, not a model. It is hovering over a drawing view and selecting a drawing curve. But you want to know what is creating the drawing curve, so you find the ModelGeometry that created the curve. That will be an edge in your model. Then it is just a matter of finding the component occurrence that the edge belongs to. That is what is happening on line 19 and 20.
More accurately, I am not just dealing with edges, but edge proxies. For example, a sphere looks like a circle in a drawing view i.e. a sphere will project a curve in a drawing view. But there is no edge to be found on a sphere, it is generating an edgeproxy.
Some of the code I have sorts through edges and edge proxies to find the parent part file. But this code does something clever. If I have a curve, it must have come from an edge or an edge proxy. And that edge or edge proxy must have come from a sketch. So line 19 is getting the sketch that created the edge (in the model) that creates the curve (in the drawing view). And sketches belong to a part file so you can find out which part the curve belongs to.
Here, since you already have a curve in the drawing view, you get the sketch proxy that created the edge (or edge proxy) and find out which occurrence the sketch proxy belongs to.
Dim someProxy As SketchProxy 'changed
Set someProxy = parentCurve.ModelGeometry
Dim partOcc As ComponentOccurrence
Set partOcc = someProxy.ContainingOccurrence
I also notice that you have Strict On. I have noticed that sometimes that setting will give you nuisance warnings about casting types when you you are dealing with specific object types and putting in a collection of generic objects. The code works fine, so set Strict Off, because I do not need the warning.
Lastly, I am not sure of your motivation to use VBA. I have settled on iLogic for many of my tiny coding projects. It is easy to migrate whenever I update Inventor. There are some ilogic functions that greatly simplify common tasks with a single line of code. You can have ilogic assigned to a button on an ilogic form. There are even helper add-ins to allow you to put it on the menu bar.