Hexagon Geospatial
MENU

Developers Knowledge Base

GeoMedia, a comprehensive and dynamic GIS, extracts compelling intelligence from geospatial data and integrates it to present actionable information.
Showing results for 
Search instead for 
Do you mean 

How to determine the originating pipe for a CustomFields pipe?

by jmorris on ‎03-14-2016 01:29 PM - edited on ‎04-06-2016 02:24 PM by Moderator (664 Views)

Question

If a legend entry recordset came from a CustomFieldsPipe, is it possible to get the real name for the pipe that was actually used? (It could have been, for example 'AddNewGeometryColumnPipe'.) 

Answer

There's a technique to determine the "outer pipe", but it is not completely robust. The CustomFieldsPipe object takes as input an object that implements the IGM_CustomFieldsService interface. Normally, the outer pipe, such as the example AddNewGeometryColumnPipe, will be the class that implements the service. In this case, you can get an instance to the outer pipe by:

' Assumes the GRecordset being passed in came from the CustomFieldsPipe.
' Also assumes that the outer pipe, AddNewGeometryColumnPipe, implements IGM_CustomFieldsService.
public sub DisplayOutputFieldName( grs as GRecordset )

  Dim objANGCP as AddNewGeometryColumnPipe
  Dim objCFP as CustomFieldsPipe

  set objCFP = grs.GetExtension( "CustomFieldsPipe" )
  set objANGCP = objCFP.CustomFieldsService

  MsgBox objANGCP.OutputFieldName

end sub

This will only work if the outer pipe is the same class that implements the IGM_CustomFieldsService interface. If so, the object returned from the objCFP.CustomFieldsService property is the outer pipe. And since the outer pipe also exposes its outer pipe interface (the one with, for example, the OutputFieldName property), setting objANGCP to this pipe will do a COM QueryInterface call that will return the outer pipe's interface. The drawback, of course, is if the IGM_CustomFieldsService is implemented by a different class than the outer pipe.

Comments
by antoniotobella
on ‎05-31-2018 12:10 AM

And in C#?

Overview
Contributors