AnsweredAssumed Answered

Any better method than SelectByID2?

Question asked by John Alexander on Jun 13, 2017

I'm trying to get a reference to silhouette edges in a drawing view. In a previous post, I learned that what I consider to be the best-practice method isn't possible due to what is probably a bug with the GetVisibleEntities function for SW2012 that has since been fixed.


GetVisibleEntities causes crash when type is swViewEntityType_SilhouetteEdge


My workaround has been to compute the silhouette edges using Face::GetSilhoutteEdgesVB, transform the vertices of an edge returned by that method to the drawing view's coordinate system and then perform SelectByID2 on that drawing view at the midpoint (or mid-curve if the silhouette edge isn't linear).


This approach has managed to get a reference to the desired silhouette edge about 90% of the time. I would like this macro to be more robust than that. The problem with SelectByID2 is that it seems to be dependent on the camera viewport.



If I zoom out far enough or just don't have the model in focus, the midpoint selection method fails on that chamfered corner.


My question is, given a known position of a SilhouetteEdge in a drawing view, are there better techniques for getting a reference to that object? Are there better methods of going from an Edge generated by GetSilhouetteEdgesVB to its corresponding SilhouetteEdge in the drawing view without relying on selection?