- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've created a path from a user selected SketchCurve, using the tangentChainCurves option. I'd like to find out where along the Path the user selected SketchCurve lies.
When I iterate on the Path object, I get PathEntities, which (I think) are transient curves derived from the chained SketchCurves. That makes sense as the path should be a sequence of curves with a common direction, and SketchCurve direction isn't deterministic. Fortunately PathEntities have an entity member that "gets the sketch curve or edge this entity was derived from." I printed the classType of the first entity was SketchLine, which is correct for my sketch. I tried iterating through the Path, and casting its entities as SketchCurve, in the hope an equality operator might detect identity with my original SketchCurve. Doesn't seem to work though.
segCount = 0 for thisSegment in path: thisCurve = adsk.fusion.SketchCurve.cast(thisSegment.entity) ui.messageBox("curve type: " + thisCurve.classType()) if thisCurve == selectedCurve: ui.messageBox ("found the user's SketchCurve: ", str(segCount)) segCount += 1
I could compare start/end points, but that's messy and I think I'm missing something.
I'd also like to understand evaluators better, maybe I could use them for my purpose. What is a CurveEvaluator3D "parameter position"? I thought it might be length along the curve, but if that were true the "getLengthAtPosition" method wouldn't make sense.
Solved! Go to Solution.