Select the sketch and delete
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("D1@Sketch1@Part1.SLDPRT", "DIMENSION", 2.59476034393162E-02, 0.034195848241218, 0, False, 0, Nothing, 0)
I haven't found a method to get the dimension from segment. You should work in opposite direction: traverse all dimensions in the sketch: Feature::GetFirstDisplayDimension->Feature::GetNextDisplayDimension and get the attached entities from every dimension to find the dimension which is attached to you line: IDisplayDimension::GetAnnotation->Annotation::GetAttachedEntities3. Then select and delete this dimension.
Application Engineer at Intercad
Tel: +61 2 9454 4444