Issue in Selecting a Silhouette in Drawing view

Hello experts,

Issue in Selecting a Silhouette in Drawing view as shown below. This is an assembly drawing and the component is a hollow tube.

bool = swActiveDoc.Extension.SelectByRay(viewCen(0), viewCen(1) + (((2361.15 / 2) / 20) / 1000), -0, 0, 0, -1, 1, swSelectType_e.swSelSILHOUETTES, False, 0, 0)

This is my code the coordinates are exactly same. But if I run this code straight after inserting the view, it is not working but if I manually hover over that Silhouette and run this code it works. How to overcome.