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
jai
Contributor
Posts: 41
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

 

 

Highlighted
jai
Contributor
Posts: 41
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

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