Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 52
Registered: ‎11-10-2015

[GM Automation] Get the full category path in the CustomPropertiesAdvisor

Hi all

 

I have written a custom code to be able to replace the default Properties Windows by a custom one. Everything works fine except when two different categories are present in the GWS with the same name (the full path is different, but the name is the same)

 

My problem is to get the full path category from the customPropertiesAdvisor.RecordSet object

 

I use the following code to get the Query corresponding to the current clicked record :

 Intergraph.GeoMedia.PDBPipe.Query rsquery = (Intergraph.GeoMedia.PDBPipe.Query)_customPropertiesAdvisor.RecordSet.GetExtension("Name");

 

In theory (in the GeoMedia Object Reference documentation), we can see that the FolderPath property contains the path of the query (Categories.1stLevel.2ndLevel.CategoryName), but... in all cases for me, this property is empty. The Name property gives to me the name of the category, but... if 2 (or more) categories have the same name in the GWS, it is impossible to make the difference between them

 

My questions :

  • Is it a bug or not if the rsquery.FolderPath is empty?
  • If not, what is the way to get this information through automation?

Regards

Technical Evangelist
Posts: 501
Registered: ‎09-11-2015

Re: [GM Automation] Get the full category path in the CustomPropertiesAdvisor

Hi,

 

I have tested that the queries from the Categories query folder have the FolderPath property assigned. Even all queries from Document.Query folder have this property, queries from the "Queries" folder have this property set to "Queries", and queries from the "Features" folder have this property set to "Features".

 

So this means that the Recordset passed to the CustomPropertiesAdvisor is not the one stored in the Document.QueryFolder. Are you sure that the inspected recordset is in a QueryFolder? It should be there if you add it to the legend using GUI, but if it has been added to the legend using for example a custom code, then this part might have been omitted. You should double check that.

 

Pavel

Contributor
Posts: 52
Registered: ‎11-10-2015

Re: [GM Automation] Get the full category path in the CustomPropertiesAdvisor

Hi Pavel
The Recordset has been manually added from existing categories. No custom code to create it.
When you say you have tested some Recordsets, are you inside a CustomPropertiesAdvisor or not? I can send you a simple code and an example of Geoworkspace based on USSampleData with manually created categories. You will see that the full path is not accessible.
Regards
Technical Evangelist
Posts: 501
Registered: ‎09-11-2015

Re: [GM Automation] Get the full category path in the CustomPropertiesAdvisor

No, I was not testing a custom properties advisor. Just checked the Query objects in the Document.QueryFolder, if they have the property set. And they do. You can send me the code to demonstrate the problem, but perhaps it would be better to create a support ticket. It would be assigned to me anyway. (Or you can assign it to me directly, not putting it into GeoMedia queue.)

 

Thanks, Pavel

Contributor
Posts: 52
Registered: ‎11-10-2015

Re: [GM Automation] Get the full category path in the CustomPropertiesAdvisor

Hi Pavel,

I will creata a support ticket in parallel. I have attached to this discussion a zip file with all the elements to reproduce the behavior. In the zip file, tou will find :

  • the code
  • a .bat to register the dll
  • a gws to reproduce the behavior

In this GWS, I have created a category aaa, a sub-category bbb and sub-sub-category ccc. I have added States in ccc with the following changes

  • name is 'States - Category'
  • I have rename POP by Population
  • I have uncheck the ASIANPOP, BLKPOP, ... attributes

I have added this category in the legend, when you double click on a state, you get a MessageBox with the .Name and .FolderPath properties of the query associated to the RecordSet

 

 

void _customPropertiesAdvisor_BeginDisplayPropertiesDialog(ref bool Cancel, ref bool DialogCancelled)
        {
            Cancel = false;

            // ENTER LOGIC HERE TO DISPLAY YOUR CUSTOM PROPERTIES DIALOG
            // e.g. if the intention is to display data from a source table named "STATES":

            Intergraph.GeoMedia.PDBPipe.Query rsquery = (Intergraph.GeoMedia.PDBPipe.Query)_customPropertiesAdvisor.RecordSet.GetExtension("Name");

            MessageBox.Show("Name : " + rsquery.Name + "\n\nFolderPath : " + rsquery.FolderPath);

The folderpath info is void

 

Regards,

Contributor
Posts: 52
Registered: ‎11-10-2015

Re: [GM Automation] Get the full category path in the CustomPropertiesAdvisor

Pavel,

 

I have created the 00035634 ticket. Unfortunately, I have not the sufficient privileges to affect it to you directly, it is in the generic Queue. I have added your email adress in the 'email to copy' section

 

Regards

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.