I'm attempting to "simplify" the element selection process for my tool. In my model I will have cells whose origin lie atop linear elements. I want to be able to determine the "intersection" of the cell's origin and the linear element, and have the result of the locate process return (hilite) the linear element and the intersection location. I know I can use "origin" snap, and find the cell's origin, then "reset" until the linear element is found, but it also seems that one should (I hope) be able to use a single datapoint to do all that (activate origin snap, and move cursor over any part of the cell, which "finds" the origin, and then datapoint to have the tool perform it's locate at the found origin, not the actual datapoint location, then cycle thru the elements at that origin until a linear element is found).
I've tried to test if AccuSnap is active in OnDataButton(), and if it is, get the current SnapPath, and SnapPoint, creating a new MstnButtonEvent and passing it to __super::OnDataButton():
if ( mdlAccuSnap_isSnapped() )
newEv.SetPoint( mdlSnapPath_getSnapPoint ( snapPath ) );
bool rc = __super::OnDataButton( &newEv );
But that's just like picking the cell with a datapoint on some part of the cell. Using RESET doesn't cycle thru any elements.
The problem with this approach is that locate will only find overlapping elements within locate tolerance of the cursor location. Locate first identities the candidate elements, then we evaluate the snap location for the "best" candidate; we don't locate anything at the snap location. So in the image below, when locating this cell by the locate point shown, it's not going to find the red line that happens to have it's end point coincident with the cell origin. Make sense?
Brien Bastings said:Make sense?
Not completely, but I'll accept your explanation. So, with that in mind, is there any way achieve my goal short of extracting the origin if/when a cell is "picked" and then do my own scan of the model, setting a range based criteria around the origin?
Bruce Reeves SRNS said:So, with that in mind, is there any way achieve my goal short of extracting the origin if/when a cell is "picked" and then do my own scan of the model, setting a range based criteria around the origin?
Getting the picked cell's origin and then scanning for lines at that location is how I would do this.