<div dir="ltr">Hi Somesh,<div><br></div><div>You can do this with the COM API as follows:</div><div>var child = ((MgaModel)subject).CreateChildObject(((MgaMetaModel)subject.MetaBase).RoleByName["Kind"]);<br></div><div>(The role name is typically the name of the metamodel Model, Atom, Reference, or Set)</div><div><br></div><div><br></div><div>But I would suggest using the CSharpDSMLGenerator (the .NET button in MetaGME). This generates a .dll which you can reference, then use like:</div><div><div><br></div><div>MgaFCO subject;</div><div>var component = ISIS.GME.Dsml.CyPhyML.Classes.Component.Cast(subject);</div><div>var parameter = ISIS.GME.Dsml.CyPhyML.Classes.Parameter.Create(component);</div></div><div><br></div><div>The domain-specific API is more convenient. (But it uses the COM API under the hood, so anything you can do in the domain-specific API can be done with the COM API).</div><div><br></div><div>Kevin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 1, 2018 at 4:40 AM, Somesh Das <span dir="ltr"><<a href="mailto:somesh_au@yahoo.com" target="_blank">somesh_au@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div><div>Hi,</div><div>I am creating an interpreter for GME using C#. I want to create child objects programmatically. For this, first I have to get all child objects defined in the metamodel.</div><div>In C++, we can get all child objects using "getFCOmeta().childFCOs()" and for creating child objects we use "myAtom = BON::Atom::create(parent,<wbr>childObj->KindName);"</div><div>Now, my question is, which methods are available in C# to perform above mentioned operation (i.e. getting child objects from meta and creating childobject).</div><div><br></div><div class="m_14726383269684827ydp81b86650signature"><font face="HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="2">Thanks & Regards<span class="HOEnZb"><font color="#888888"><br>Somesh Das<br><br></font></span></font></div></div></div></div><br>______________________________<wbr>_________________<br>
gme-users mailing list<br>
<a href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users@list.isis.<wbr>vanderbilt.edu</a><br>
<a href="http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/gme-users" rel="noreferrer" target="_blank">http://list.isis.vanderbilt.<wbr>edu/cgi-bin/mailman/listinfo/<wbr>gme-users</a><br>
<br></blockquote></div><br></div>