pInPoint = New Point ' Create a new point pInPoint.SpatialReference = pSpatialRef ' Previously obtained Spatial Reference from input lines pInPoint = pSegment.ToPoint ' Set the new point to the point of interest from the segment pInPoint.M = distAlong ' in other parts of my code distAlong keeps track of accumulated 3D distances along the line pSegment.ToPoint = pInPoint ' replace the point of interest with the modified M coordinate
SegCount = pSegColl.SegmentCount For j = 0 To SegCount - 1 pSegment = pSegColl.Segment(j) pInPoint = New Point 'If you needed to modify the segment points do the next steps pInPoint.SpatialReference = pSpatialRef pInPoint = pSegment.FromPoint ' Do something with the segment point pSegment.FromPoint = pInPoint pSegColl.SegmentsChanged() ' Send out Segment Changed Message event pInPoint = Nothing ' Clean up Point Object Next j
Take a look at the IHitTest interface. It can tell you if a point is on the line as well as the segment index of the segment in the line's segment collection. If the line is multi-part, it will also tell you the part index in the line's geometry collection.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.