[gme-users] About Programatically Set Selection to an Object in GME

Kevin Smyth kevin.m.smyth at gmail.com
Mon Oct 23 13:27:35 CDT 2017


1. You want the ShowFCO method on the GME interface (IGMEOleIt):
[helpstring("ShowFCO - accepts relative path both up and down. For models
only: If InParent == true shown selected in parent, otherwise opened.")]
HRESULT ShowFCO( [in] BSTR path, [in, defaultvalue(0)] VARIANT_BOOL
inParent );

You can get the GME interface from the project:

project->GetClientByName(_bstr_t(L"GME.Application"), &client)

2.
Yes, that's what the hyperlinks do. You could try writing a link like <a
href="javascript:gme.MgaProject.BeginTransactionInNewTerr();
gme.ShowFCO(gme.MgaProject.GetFCOByID("id-0065-000011"), true);
gme.MgaProject.CommitTransaction()">model</a>
(I haven't tested this code. You may need to call ShowFCO outside the
transaction)

Kevin



On Mon, Oct 23, 2017 at 4:54 AM, Somesh Das <somesh_au at yahoo.com> wrote:

> Hi,
> I am developing an interpreter for GME which will find out all objects
> connected with selected objects.
> For this purpose I need set selection on a set of objects in GME. I tried
> to get the default decorator for GME and tried the following code
>
> HRESULT hres = decorator.CoCreateInstance(L"MGA.BoxDecorator" );
> decorator->Initialize(project->getProjectI(), NULL,fco (intended fco));
> decorator->SetSelected(value);
>
> However this code is not working.
>
> Actually my intention is to make a hyperlink of all connected fco. If user
> clicks on the hyperlink then corresponding fco will be shown up and tried
> the following code
>
> Console::Out::WriteLine(CString("-> Source: ") + Formatter::
> MakeObjectHyperlink(CString(namePath.c_str()), CString(connEnd->getID().c_
> str())));
>
> For Atom this code is working but if the connected fco is model then if
> select the hyperlink then its going inside the model which is not my
> intend. I want to make selection only.
>
> Please can anybody suggest me how to make a selection on an object
> Programatically.
>
> Thanks & Regards
> Somesh Das
>
>
> _______________________________________________
> 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/20171023/e7d6eb41/attachment.html>


More information about the gme-users mailing list