2

I am fairly new to Arc Programming and am currently using .net to build my tool.

There is not much back ground information as I am starting from a Blank Map. The goal of my tool is just to create a short cut (Hotkey) feature in order to place perpendicular lines.

I am attempting to use the function, IConstructPoint2.ConstructPerpendicular() but it requires that I use ISegment as an input.

Prior to this, the only EVENT I am using to capture the points that I place on the map are IEditEvents2.OnVertexAdded(IPoint). How can I capture the line segment that is constructed immediately after putting down a second point on the map?

Kirk Kuykendall
25.8k9 gold badges68 silver badges155 bronze badges
asked Feb 11, 2019 at 15:48
2
  • Did you try casting IEditSketch3.Geometry to an ISegmentCollection and getting the first one? Commented Feb 11, 2019 at 22:12
  • Hey Kirk, This is exactly what I needed. Thank you! Commented Feb 13, 2019 at 16:12

1 Answer 1

1

Try casting the editor to IEditSketch3, then cast IEditSketch3.Geometry to an ISegmentCollection, and get the first segment.

answered Feb 13, 2019 at 20:15
1
  • 1
    I think the OP is after the last segment. From IEditSketch3 casting the Geometry to an IGeometryCollection (just in case of multiple parts), get the part (indexed by IEditSketch.Part), cast that part (IGeometry) to an ISegmentCollection then get the segment indexed by IEditSketch.Segment. Before this though you'll need to check the current part has at least 2 points by casting to IPointCollection and getting the PointCount, if == 1 then bail out. Commented Feb 22, 2019 at 0:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.