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: 63
Registered: ‎02-22-2016

Need to execute custom script after IG.captureGeometry() is done

I want to execute my custom script after any "IG.captureGeometry()" function in any workflow.

 

Found that IG.captureGeometry calls IG.startEdit edit internally. The definition was like follows

 

IG.startEdit = function (featureIdOrName, actions, elementIds, styleId, persistanceLocation) {
    try {
        var actionArray = IG.convertToArray(actions);
        var elementArray = IG.convertToArray(elementIds);
        SmartClientEditScriptingObject().startEdit(featureIdOrName, actionArray, elementArray, styleId, persistanceLocation);        
        IG.closeWebBrowser();
    } catch (err) {
        alert(err);
    }
}

 

 

The above script says that I may have to write my custom script somewhere in

SmartClientEditScriptingObject().startEdit

Is it true and how can I do that?

 

My custom script is about just setting a particular feature active always after any captureGeometry function.

Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: Need to execute custom script after IG.captureGeometry() is done

[ Edited ]

Hi Vipath,

 

try to check this ... http://community.hexagongeospatial.com/t5/Developer-Discussions/Reload-defined-features-after-editin...

 

and you can set your feature active this way.

 

Feature feature = ApplicationContext.getProject().getFeatureByTitleOrID("YourSimpleIdOfFeature");
feature.setActive(true);

 

I am not 100 % sure that this is the only way, but I haven't found another one.

 

Regards,

Jakub

Contributor
Posts: 63
Registered: ‎02-22-2016

Re: Need to execute custom script after IG.captureGeometry() is done

Hi jakub,

I'm a newbie to GMSC. Though I understood the procedure (and I can program in Java) I'm not aware of the Location of Java class files or the way to use your repository. Can you please help me with any available quick tutorial or doc.

Thanks,
Vipanth
Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: Need to execute custom script after IG.captureGeometry() is done

Hi Vipath,

 

try to check your topic here. I think I have shared everything you need Smiley Happy

 

My repository is just my examples. Feel free to use it - you will probably need bitbucket account - it's free. It's public and without any relation to the development center or officially supported channels. Just few plugins what we have developed and we can share them.

 

Regards,

Jakub

 

 

Contributor
Posts: 63
Registered: ‎02-22-2016

Re: Need to execute custom script after IG.captureGeometry() is done

Jakub,

 

Yes, had a look at all those links. Will sure work it out.

 

 

Thanks,

Vipanth

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