Select to view content in your preferred language

ISegmentCollection QuerySegments vs IGeometryBridge QuerySegments VB.NET

514
2
08-30-2010 10:25 PM
tonydavid
Occasional Contributor
ISegmentCollection.QuerySegments method is now replaced with IGeometryBridge.QuerySegments method for .NET

Both have different methods and results!!!

Am just trying to convert this 2 lines ...

pOrigSegs.QuerySegments(lNoHitStart, lNoHitCount - 1, pOutSegs(0))
m_pSegmentCollectionFrmNewGeom.AddSegments(lNoHitCount - 1, pOutSegs(0))

Has anyone faced same issue? Any ideas? No sample for VB.NET in Help ...
0 Kudos
2 Replies
NeilClemmons
Honored Contributor
The method on ISegmentCollection takes the start index, the number of segments to return, and an array which gets populated with the returned segments.  The method on IGeometryBridge takes in the segment collection you want to query, the start index, and the array to populate with the results.  As shown in the C# example, you specify how many segments you want returned by dimensioning the output array to that number and initializing each index position.

It is done this way because the old method on ISegmentCollection uses a C-style array, meaning it is expected that all index positions in the array are sequential in memory.  Not all languages implement arrays in this manner.  These languages allow index positions to be anywhere in memory (implemented more like a linked list than a sequential memory block).  This is why the method on IGeometryBridge requires you to initialize each index position within the output array.  The array defines where each index position resides in memory and all the method does is update the object instance at each position.
0 Kudos
tonydavid
Occasional Contributor
thanks ... good explanation!!! Will work on this ... 🙂
0 Kudos