0

I have created an arc based three points (from point, through point, and to point). To create the arc I used this code:

import arcpy, comtypes.client
import comtypes.client.CreateObject as CreateObject
import comtypes.gen.esriGeometry as esriGeometry

FromObjIPoint = CreateObject(esriGeometry.Point, interface=esriGeometry.IPoint)
FromObjIPoint.PutCoords(FromX, FromY)

MidObjIPoint = CreateObject(esriGeometry.Point, interface=esriGeometry.IPoint)
MidObjIPoint.PutCoords(MidX, MidY)

ToObjIPoint = CreateObject(esriGeometry.Point, interface=esriGeometry.IPoint)
ToObjIPoint.PutCoords(ToX, ToY)

ThreePtArc = CreateObject(esriGeometry.CircularArc, interface=esriGeometry.IConstructCircularArc)
ThreePtArc.ConstructThreePoints(FromObjIPoint, MidObjIPoint, ToObjIPoint, True)

My problem is that I need to test to see the direction in which the arc is generated (clockwise or counterclockwise). There is an IsCounterClockwise property, but it is part of the ICircularArc interface, not the IConstructCircularArc interface I used to create the arc.

Any ideas on how I can test the direction of the arc?

1

You want to QueryInterface.

circular_arc = ThreePtArc.QueryInterface(esriGeometry.ICircularArc)
counter_clockwise = circular_arc.IsCounterClockwise

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.