Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

You want to QueryInterface.

circular_arc = ThreePtArc.QueryInterface(esriGeometry.ICircularArc)
counter_clockwise = circular_arc.IsCounterClockwise
share|improve this answer
    
That worked, thank you. –  Nicholas Graf Jan 31 '13 at 23:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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