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

Somesh Das somesh_au at yahoo.com
Mon Nov 6 05:12:40 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 attached a screenshot of the error. 


Thanks & Regards 
Somesh That

 

    On Friday, October 27, 2017, 12:21:56 PM GMT+2, Somesh Das <somesh_au at yahoo.com> wrote:  
 
 Hi Kevin,I have already tried this but I got same error.
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)
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/20171106/a8f8184a/attachment.html>


More information about the gme-users mailing list