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

Somesh Das somesh_au at yahoo.com
Tue Nov 7 03:57:14 CST 2017

Hi Kavin,I tried with single quotation instead of double quotation and wrote the following code:CString result ("<a href = \" javascript: gme.MgaProject.BeginTransactionInNewTerr (); gme.ShowFCO (gme.MgaProject.GetFCOByID ('id-0065-00000004'), true); gme.MgaProject.CommitTransaction (); \ ">" + text + "</a>");

However in GME when I click on the link then it shows me an error "Could not complete operation due to error 87650036".I also tried with double quotation which also shows error.  I attached a screenshots of the errors. 

Thanks & Regards 
Somesh Das


    On Thursday, October 26, 2017, 2:48:21 PM GMT+2, Kevin Smyth <kevin.m.smyth at gmail.com> wrote:  
 I think you need:
result + = """ + objectId + """; // id of the object

On Thu, Oct 26, 2017 at 4:22 AM, Somesh Das <somesh_au at yahoo.com> wrote:

Hi Kevin,I tried the code you suggested as follows :CString    result ("<a href = \" javascript: ");
 result + = "gme.MgaProject. BeginTransactionInNewTerr (); gme.ShowFCO (gme.MgaProject.GetFCOByID (";
 result + = objectId; // id of the object
 result + = "), true); gme.MgaProject. CommitTransaction ();";
 result + = "\"> ";
 result + = text; // name of the object result + = "</a>";But in GME when I click on the hyperlink its showing a script error. I attached the screen shot of the error. Please let me know if I am doing any mistake. Thanks & Regards 
Somesh Das


    On Monday, October 23, 2017 8:27 PM, Kevin Smyth <kevin.m.smyth at gmail.com> wrote:

 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)

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/20171107/8e4b0468/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Error_with_double_qoutation.jpg
Type: image/jpeg
Size: 79983 bytes
Desc: not available
URL: <http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20171107/8e4b0468/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Error_with_single_qoutation.jpg
Type: image/jpeg
Size: 99516 bytes
Desc: not available
URL: <http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20171107/8e4b0468/attachment-0001.jpg>

More information about the gme-users mailing list