LeafOccurrences are ALL occurrences in an assembly. If you just cycle through Occurrences you will only get the first level, but if you had an assembly inside an assembly, and wanted to access the parts within it, you need to use LeafOccurrences.
oCurves.Count is representing how many "Lines" are on the drawing that are a result of the named entity. For example, if you targeted a face, and on the drawing you could only see one edge of that face, oCurves.Count would return 1. If you could see the whole face (assuming its a square) it would return 4.
I managed to get this working with the files you provided:
Sub Main
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView = oDoc.ActiveSheet.DrawingViews(1)
Dim oAsm As AssemblyDocument = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oEntity1 As Object, oEntity2 As Object
For Each oComp As ComponentOccurrence In oAsm.ComponentDefinition.Occurrences.AllLeafOccurrences
Dim oNamedEnts As NamedEntities = iLogicVb.Automation.GetNamedEntities(oComp.Definition.Document)
If oComp.Name.Contains("RH Track")
oEntity1 = oNamedEnts.FindEntity("Edge0")
oComp.CreateGeometryProxy(oEntity1, oEnt1Proxy)
End If
If oComp.Name.Contains("MRR Spiral")
oEntity2 = oNamedEnts.FindEntity("Edge4")
oComp.CreateGeometryProxy(oEntity2, oEnt2Proxy)
End If
Next
Dim oCurve1 As DrawingCurve = oView.DrawingCurves(oEnt1Proxy)(1)
Dim oCurve2 As DrawingCurve = oView.DrawingCurves(oEnt2Proxy)(1)
Dim oInt1 As GeometryIntent = oSheet.CreateGeometryIntent(oCurve1, kStartPointIntent)
Dim oInt2 As GeometryIntent = oSheet.CreateGeometryIntent(oCurve2, kStartPointIntent)
Dim GenDims As GeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions
Dim oPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)
GenDims.AddLinear(oPoint, oInt1, oInt2, kVerticalDimensionType)
End Sub