[gme-users] Invoking an Add-On from a Decorator event

Cinthya Lopez Cinthya_K_Lopez at raytheon.com
Tue Feb 27 16:11:47 CST 2018


Thank you Kevin, I was able to get it to work after reviewing the example and reviewing the GME documentation on Territories. Out of curiosity, what is the purpose of the transactiontype_enum parameter you can pass in when starting a transaction? I used transactiontype_enum.TRANSACTION_GENERAL in my code but the example you provided also uses transactiontype_enum.TRANSACTION_NON_NESTED at times. I couldn’t find anything in the GME documentation that explains what each of these mean.

Also, going back to my previous post on calling AppendMenu to add a context menu item under “Decorator Edit”. I am finding out that the ID from the C# example (CTX_MENU_ID = 0x4001 + 100) does not work for instances of an objects. My context menu comes up enabled for the Type of my atom but it shows disabled for an Instance of it.

I am currently investigating why this would be the case. I know you mentioned you weren’t sure why this ID works and others don’t.

Thanks,
Cinthya

From: gme-users [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Kevin Smyth
Sent: Monday, February 26, 2018 11:22 AM
To: A list for GME users to share thoughts and discuss bugs and fixes. <gme-users at list.isis.vanderbilt.edu>
Subject: [External] Re: [gme-users] Invoking an Add-On from a Decorator event

Hi Cinthya,

IMgaProject.AddOnComponents is the way to do this. You can find an example here: https://github.com/metamorph-inc/meta-core/blob/master/src/CyPhyMetaLink/CyPhyMetaLinkInterpreter.cs#L517

Kevin



On Mon, Feb 26, 2018 at 12:03 PM, Cinthya Lopez <Cinthya_K_Lopez at raytheon.com<mailto:Cinthya_K_Lopez at raytheon.com>> wrote:
Hi all,

Does anyone know the recommended way to invoke an Add-On from a Decorator’s event?

Currently I create an instance to my Add-On and call its ObjectEvent() function directly from my Decorator. This allowed me to run my add-on code but my current issue is that the add-on code brings up a form that allows the user to update an atom’s attribute value. When the add-on form is brought up by the decorator the attribute’s value is not updated with the new value; even though, MgaAtom. set_StrAttrByName() is called. If I understand correctly, an add-on is always running in the background, so should I be able to grab a reference to it instead of creating a new instance of it? I am thinking my issue could be that I am creating a new instance of the add-on instead of calling the instance that is currently running.

Thanks,
Cinthya

_______________________________________________
gme-users mailing list
gme-users at list.isis.vanderbilt.edu<mailto:gme-users at list.isis.vanderbilt.edu>
http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/gme-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20180227/afcfdeab/attachment.html>


More information about the gme-users mailing list