How to select this edge line?


I can only get the edge line of the component using this method
https://help.solidworks.com/2016/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.iview~getvisibleentities2.html

This is what I want

Do I understand you correctly - you want to select the red marked edges? But these are two edges, right? One edge is a line and one edge is a radius. So, if you are able to select the edge with the 70mm-length, you also should be able to select the radius. You need to make sure that you don’t filter your selection with something like IsLine() (ICurve interface).

I want to find the edge of 80
i use
vEdges = (object)drView.GetVisibleEntities2(Comp, (int)swViewEntityType_e.swViewEntityType_Edge);

There is no edge 80 in the result. I did not use IsLine() and other conditions to filter.

Correct me if I’m wrong, but I suspect you wouldn’t find an edge with a length of 80mm. You will probably find two edges: one edge with a length of 70mm and one edge with a length of ~ 15.71mm (that’s the radian)

Maybe you are right. Why can I select an edge directly with the mouse?


This line is not an edge in Component, how to find it

Hm, that’s strange… could it be something like a silhouette edge? Have you tried using the macro recorder to check what kind of selection you got?