GMSC Discussions

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 37
Registered: ‎10-12-2015
Accepted Solution

Not able able to get GPrimitive in smart client

Hi Team,

 

I am able to get GPrimitive for single selected item most of the time but yes some it is also null. When i pass list of selected item like "AA,GN,BI,YR" i get GPrimitive very rare.

 

 

I am passing selectedElement ="AA,BI,YR,GN"

 

Code snippet:

 

public Object setFilter(String sourceFeature, String featureToFilter, String selectedElement)
{

return swingInvoke(() -> {
                     Feature toActivate = ApplicationContext.getProject().getFeatureByTitleOrID(sourceFeature);
                     if(toActivate == null)
                           Deferred.reject("feature not found");

                     toActivate.setActive(true);
                     ApplicationContext.getBrowser().getMapSelectionCurator().clearSelection();
                     ApplicationContext.getBrowser().getMapSelectionCurator().select(new Object[]{selectedElement});

                     String[] selectedIds = selectedElement.split(",");
                     GPrimitive[] selectedItems = new GPrimitive[selectedIds.length];
                     int count =0;
                     for(int i=0;i<selectedIds.length;i++)
                     {
                              GPrimitive item =ApplicationContext.getBrowser().getElement(selectedIds[i]);
                              if(item != null)
                              {
                                      selectedItems[i] = item;
                                       count++;
                              }
                     }.....

               .....}

I am also not able to locate java API link in http://community.hexagongeospatial which was on "http://smartclient.intergraph.at/".

 

Thanks,

Jai Ram Gaur

 

 

Contributor
Posts: 37
Registered: ‎10-12-2015

Re: Not able able to get GPrimitive in smart client

Hi Team,

 

Found solution for the issue. Filtered feature need to be clear before getting GPrimitive from "ApplicationContext.getBrowser().getElement(selectedIds[i])".

 

Thanks,

Jai Ram Gaur