I think the simplest way is to get the bounding box of your component after it is inserted and verify the orientation (and flip if necessarily): 2015 SOLIDWORKS API Help - GetBox Method (IComponent)
I believe the initial orientation is calculated in respect to edge direction (start and end vertices) as well as edge sense (2014 SOLIDWORKS API Help - EdgeInFaceSense Method (IEdge))
Thanks for the reply Artem,
That could work on the first dimension because the inserted part would be flipped outside of the brown part but the second dimension will have the bounding boxes intersect no matter the flip just because the distance is so small.
I am currently trying to add a coordinate system at the intersect point, use the other 2 points for X and Y and insert the parts using the inserted.
Any other thoughts or ideas are welcome!!
In case others would like to attempt the same here is an update. I have gone down the path of creating a coordinate system, but unfortunately one cannot leverage the relative location of a created coordinate system to locate an inserted part.
Unless, of course, I have missed something and someone can enlighten me on the use of Coordinate systems.
My next attempt is to create a sketch on the 2 selected lines, create points in the sketch, and try to add the parts based on the sketch. I am having serious doubts because if I cannot control the direction of a dimension, flip or not, within an assembly what better luck will I have within a sketch?
Any help would be greatly appreciated.
Just for future reference, I have my solution. There are a myriad of details that I don't have the time to go into, but the short of it is here for the next person trying to accomplish the same:
1. User selects 2 intersecting edges
2. Use Parallel mates to align the new part
3. Use Midpoint to axis mate to center the part
4. Sketchpoints within the inserted part measuring to the endpoints of the user selected edges to gain relative orientation. (It takes about 4 or 5 measurements to determine orientation.)
5. Linear pattern to gain multiple instances with the flip option defined during step 4.
Patterns can be dissolved and the original part deleted, etc, to get the final results.
Hope this helps someone in the future. If you would like a more detailed explanation please message me.