<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Dear Kevin,</div>
<div>thank you very much for your help.</div>
<div> </div>
<div>Greetings from Stuttgart,</div>
<div>Dominik</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Donnerstag, 21. August 2014 um 16:59 Uhr<br/>
<b>Von:</b> "Kevin Smyth" <ksmyth@isis.vanderbilt.edu><br/>
<b>An:</b> "A list for GReAT users to share bugs, fixes and ideas" <great-users@list.isis.vanderbilt.edu><br/>
<b>Betreff:</b> Re: [great-users] Reading out GUID and Object ID of current object</div>
<div name="quoted-content">
<div style="background-color: rgb(255,255,255);">Dominik,<br/>
<br/>
I tested this code with the GReAT sample House2Order. I modified the AttributeMapping /zt_House2Order/MakeOrder1/CreateOrder, and set up the configuration to use MakeOrder1 instead of MakeOrder3.<br/>
<br/>
Getting the id-000-style id is easy. Unfortunately, getting the GUID requires the COM interface.<br/>
<br/>
// id-000....-style id<br/>
std::string gmeId = UdmGme::UdmId2GmeId(PurchaseOrder.uniqueId());<br/>
<br/>
// GUID<br/>
CComPtr<IUnknown> pUnk;<br/>
pUnk.Attach(UdmGme::Udm2Gme(PurchaseOrder)); // caveat: Udm2GME returns NULL if PurchaseOrder is a Udm XML object<br/>
CComQIPtr<IMgaFCO> pFCO = pUnk; // caveat: pFCO will be NULL if PurchaseOrder is a Folder. (You could use IMgaObject instead)<br/>
_bstr_t bstrGuid;<br/>
pFCO->GetGuidDisp(bstrGuid.GetAddress());<br/>
<br/>
PurchaseOrder.name() = std::string("PurchaseOrder") + static_cast<const char*>(bstrGuid) + gmeId;<br/>
// caveat: the static_cast uses the current code page. It should instead be UTF-8, since Udm strings are UTF-8<br/>
// PurchaseOrder.name() == PurchaseOrder{ec439575-02fa-48e0-a5cd-02e21c1c6ced}id-0065-00000001<br/>
<br/>
<br/>
This code requires 2 include files:<br/>
<br/>
<?xml version="1.0" encoding="UTF-16"?><br/>
<!DOCTYPE clipboard SYSTEM "mga.dtd" [<br/>
<!ELEMENT clipboard (folder|model|atom|reference|set|connection|regnode)*><br/>
<!ATTLIST clipboard<br/>
acceptingkind CDATA #IMPLIED<br/>
paradigmnamehint CDATA #IMPLIED<br/>
><br/>
]><br/>
<clipboard paradigmnamehint="UMLModelTransformer"><br/>
<atom id="id-0066-0000003e" kind="UserCodeLibrary" role="UserCodeLibrary"><br/>
<name>UserCodeLibrary</name><br/>
<attribute kind="IncludeFiles"><br/>
<value>atlbase.h;mga.h</value><br/>
</attribute><br/>
<attribute kind="IncludePath"><br/>
<value>C:\Program Files (x86)\GME\Interfaces</value><br/>
</attribute><br/>
</atom><br/>
</clipboard><br/>
<br/>
<br/>
Hope this helps.<br/>
<br/>
Kevin<br/>
<div class="moz-cite-prefix">On 8/21/2014 8:00 AM, Dominik Giel wrote:</div>
<blockquote>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Dear users of GReAT,</div>
<div>today I want you to ask a question about accessing the GUID and ObjectID of an object, I am currently using in a rule of my GReAT-Transformation.</div>
<div>I just need to read it and save the information in a variable, no write-access is needed. I just want to save the information of the object like it is displayed in GME into a variable.<br/>
Is there a function provided, where I can access the GUID and ObjectID which I can implement in an attribute mapping to write this information into a variable?</div>
<div> </div>
<div>I would be pleased, if someone of you could help me out with this. Thanks in advance for your help.</div>
<div> </div>
<div>Greetings from Germany,</div>
<div>Dominik Giel</div>
<div> </div>
<div>--</div>
<div>Dominik Giel</div>
<div>ILS - Institute of Airborne Systems</div>
<div>University of Stuttgart</div>
<div><a class="moz-txt-link-abbreviated" href="dominik.giel@gmx.de" target="_parent">dominik.giel@gmx.de</a></div>
<div> </div>
<div> </div>
</div>
<fieldset class="mimeAttachmentHeader"> </fieldset>
<pre>_______________________________________________
great-users mailing list
<a class="moz-txt-link-abbreviated" href="great-users@list.isis.vanderbilt.edu" target="_parent">great-users@list.isis.vanderbilt.edu</a>
<a class="moz-txt-link-freetext" href="http://list.isis.vanderbilt.edu/mailman/listinfo/great-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/great-users</a>
</pre>
</blockquote>
<br/>
_______________________________________________ great-users mailing list great-users@list.isis.vanderbilt.edu <a href="http://list.isis.vanderbilt.edu/mailman/listinfo/great-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/great-users</a></div>
</div>
</div>
</div>
</div></div></body></html>