[gme-users] Setting MgaMetaAttribute.Viewable field programatically

Cinthya Lopez Cinthya_K_Lopez at raytheon.com
Fri Nov 16 16:10:23 CST 2018


Hi,

I am trying to set MgaAttribute.Meta.Viewable = false within my Add-On. The viewable field in my metamodel for this attribute is set to True, but I want to be able to hide the attribute depending on where the user is creating this object within their model.

I am currently getting a GME error when this line is executed saying "Unable to insert object: No active transaction." I have  been playing around with beginning a transaction before executing this line by using both MgaProject. BeginTransactionInNewTerr() and MgaProject.BeginTransaction(territory) but still get the same error or I also get an error along the lines of a transaction already exists. Can the Viewable field for an MgaMetaAttribute be set programmatically? If so, what is the correct way of dealing with transactions when executing this from an Add-On's ObjectEvent() function?

Thanks,
Cinthya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20181116/2728f58c/attachment.html>


More information about the gme-users mailing list