[gme-users] Setting MgaMetaAttribute.Viewable field programatically

Kevin Smyth kevin.m.smyth at gmail.com
Mon Nov 19 11:58:03 CST 2018


Cinthya,

GME does not support modifying the metamodel at runtime.
MgaMetaAttribute.Viewable can be set in the MetaGME model by the "Viewable"
attribute on FieldAttribute.

Kevin

On Fri, Nov 16, 2018 at 4:10 PM Cinthya Lopez <Cinthya_K_Lopez at raytheon.com>
wrote:

> 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
> _______________________________________________
> gme-users mailing list
> 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/20181119/e6e1fcc2/attachment.html>


More information about the gme-users mailing list