Is there a way to toggle the direction an arc is created with .net? I have noticed that mine are being created counter clockwise and I really have a need to go the other way.
Posted by: Bob Reinkemeyer
Post date: 12/2/2005 1:24:23 AM
Here is some code.
Dim oApp As SolidEdgeFramework.Application = Marshal.GetActiveObject("SolidEdge.Application") Dim oDoc As SolidEdgeDraft.DraftDocument = oApp.ActiveDocument Dim oSheet As SolidEdgeDraft.Sheet = oDoc.ActiveSheet Dim oArc As SolidEdgeFrameworkSupport.Arc2d Dim xCen As Double = 0, yCen As Double = 0 'Dim xStart As Double = 0.1, yStart As Double = 0 'Dim xEnd As Double = 0, yEnd As Double = 0.1 Dim xStart As Double = 0, yStart As Double = 0.1 Dim xEnd As Double = 0.1, yEnd As Double = 0 oArc = oSheet.Arcs2d.AddByCenterStartEnd(xCen, yCen, xStart, yStart, xEnd, yEnd)
Two blocks of values are provided for the arc parameters, need to comment one and un-comment the other.
One set creates the arc and other creates its complimentary arc.
What is required by both me and Bob is: creating an arc going clockwise from the start to end about the center.
The API always creates an anti-clockwise arc. This is known and accepted.
If only there is a way, trick or tweak to create a clockwise arc - this would solve many issues in several design automation processes.
Thanks for the suggestion.
Changing the Orientation property results in a complimentary arc again.
This is same as swapping the start and end points.
I still want the arc to go in a fashion in the image above with the given start and end points.
JB, I think I have been able to make use of your suggestion - it was a great suggestion, though I was not able to make use of it to solve my issue initially.
What I have found is for a given arc, before changing the Orientation, swap the start and end points which prevents creation of a complementary arc.
This results in the arc going just the other way around.
Does Bob Reinkemeyer who asked the original question know that a solution has been found.
Only God knows.