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?
1 Answer 1
Try casting the editor to IEditSketch3
, then cast IEditSketch3.Geometry
to an ISegmentCollection
, and get the first segment.
-
1I 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.Michael Stimson– Michael Stimson2019年02月22日 00:16:04 +00:00Commented Feb 22, 2019 at 0:16
Explore related questions
See similar questions with these tags.
ISegmentCollection
and getting the first one?