<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>&nbsp;</div>

<div>Greetings from Stuttgart,</div>

<div>Dominik</div>

<div>&nbsp;
<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>&nbsp;Donnerstag, 21. August 2014 um 16:59 Uhr<br/>
<b>Von:</b>&nbsp;&quot;Kevin Smyth&quot; &lt;ksmyth@isis.vanderbilt.edu&gt;<br/>
<b>An:</b>&nbsp;&quot;A list for GReAT users to share bugs, fixes and ideas&quot; &lt;great-users@list.isis.vanderbilt.edu&gt;<br/>
<b>Betreff:</b>&nbsp;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&lt;IUnknown&gt; pUnk;<br/>
pUnk.Attach(UdmGme::Udm2Gme(PurchaseOrder)); // caveat: Udm2GME returns NULL if PurchaseOrder is a Udm XML object<br/>
CComQIPtr&lt;IMgaFCO&gt; pFCO = pUnk; // caveat: pFCO will be NULL if PurchaseOrder is a Folder. (You could use IMgaObject instead)<br/>
_bstr_t bstrGuid;<br/>
pFCO-&gt;GetGuidDisp(bstrGuid.GetAddress());<br/>
<br/>
PurchaseOrder.name() = std::string(&quot;PurchaseOrder&quot;) + static_cast&lt;const char*&gt;(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/>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-16&quot;?&gt;<br/>
&lt;!DOCTYPE clipboard SYSTEM &quot;mga.dtd&quot; [<br/>
&nbsp;&nbsp;&nbsp; &lt;!ELEMENT clipboard (folder&#124;model&#124;atom&#124;reference&#124;set&#124;connection&#124;regnode)*&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;!ATTLIST clipboard<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; acceptingkind CDATA #IMPLIED<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; paradigmnamehint CDATA #IMPLIED<br/>
&nbsp;&nbsp;&nbsp; &gt;<br/>
]&gt;<br/>
&lt;clipboard paradigmnamehint=&quot;UMLModelTransformer&quot;&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;atom id=&quot;id-0066-0000003e&quot; kind=&quot;UserCodeLibrary&quot; role=&quot;UserCodeLibrary&quot;&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;name&gt;UserCodeLibrary&lt;/name&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;attribute kind=&quot;IncludeFiles&quot;&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;value&gt;atlbase.h;mga.h&lt;/value&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/attribute&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;attribute kind=&quot;IncludePath&quot;&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;value&gt;C:&#92;Program Files (x86)&#92;GME&#92;Interfaces&lt;/value&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/attribute&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;/atom&gt;<br/>
&lt;/clipboard&gt;<br/>
<br/>
<br/>
Hope this helps.<br/>
<br/>
Kevin<br/>
&nbsp;
<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>&nbsp;</div>

<div>I would be pleased, if someone of you could help me out with this. Thanks in advance for your help.</div>

<div>&nbsp;</div>

<div>Greetings from Germany,</div>

<div>Dominik Giel</div>

<div>&nbsp;</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>&nbsp;</div>

<div>&nbsp;</div>
</div>
&nbsp;

<fieldset class="mimeAttachmentHeader">&nbsp;</fieldset>
&nbsp;

<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>