<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to use object plugin to get data from my tag plug-in]]></title><description><![CDATA[<p dir="auto">hi,<br />
my tag plugin(not Texpression,just Obase) code have public function to return private variable. a button on my object plug-in and my tag is the frist tag on my object.  I  want use the button to call public function and get the  private variable.this is my code,  just return 0, i really want to know what should i do.<br />
hope your help.</p>
<p dir="auto">tag  plug-in</p>
<p dir="auto">mytag.h:</p>
<pre><code>class MyTag : public TagData{
     public: 
               ...//ellipsis  virtual  func
               Int GetValue();
     private:
               Int  a = 123;

};
</code></pre>
<p dir="auto">mytag.cpp:</p>
<pre><code>Int MyTag::GetValue(){
     return this-&gt;a ;
}
</code></pre>
<p dir="auto">my object plugin code:</p>
<pre><code>#include "mytag.h"
...
...ellipsis
....
Bool MyObject::Message(GeListNode * node, Int32 type, void * data){
          DescriptionCommand* dc = (DescriptionCommand*)data;
          const Int32 id = dc-&gt;_descId[0].id;
	  switch (id)
	   {
		case GET_BUTTON:
		{	
                     BaseObject* bc = (baseobject*)node;
                     BaseTag* tag = bc-&gt;GetFirstTag();
                     Int b = ( (MyTag*)tag )-&gt;GetValue();
                     GePrint( maxon::ToString(b,false) );
                     break;
                }
            }
            return true;
}
</code></pre>
]]></description><link>http://developers.maxon.net/forum//topic/11498/how-to-use-object-plugin-to-get-data-from-my-tag-plug-in</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 20:54:22 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum//topic/11498.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Apr 2019 11:32:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to use object plugin to get data from my tag plug-in on Sat, 20 Apr 2019 03:40:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/s_bach">@<bdi>s_bach</bdi></a> Thank you for  your  answer!</p>
]]></description><link>http://developers.maxon.net/forum//post/58064</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/58064</guid><dc:creator><![CDATA[mike]]></dc:creator><pubDate>Sat, 20 Apr 2019 03:40:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to use object plugin to get data from my tag plug-in on Fri, 19 Apr 2019 15:36:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">you cannot cast the <code>BaseTag</code> pointer into your plugin class.</p>
<p dir="auto">Your plugin class is based on <a href="https://developers.maxon.net/docs/cpp/2023_2/class_tag_data.html" target="_blank" rel="noopener noreferrer nofollow ugc">TagData</a> which itself is based on <a href="https://developers.maxon.net/docs/cpp/2023_2/page_overview_nodedata.html" target="_blank" rel="noopener noreferrer nofollow ugc">NodeData</a>. So you must get the pointer to the <code>NodeData</code> instance which represents your plugin instance.</p>
<p dir="auto">This pointer is obtained with <a href="https://developers.maxon.net/docs/cpp/2023_2/class_ge_list_node.html#ade67376a1b59027a88727043ca68f6c6" target="_blank" rel="noopener noreferrer nofollow ugc">GetNodeData()</a>.</p>
<p dir="auto">See <a href="https://developers.maxon.net/docs/cpp/2023_2/page_manual_general_plugin_info.html#page_manual_general_plugin_info_basic_types" target="_blank" rel="noopener noreferrer nofollow ugc">Basic Classes and Plugin Classes</a> and <a href="https://developers.maxon.net/docs/cpp/2023_2/page_manual_gelistnode.html#page_manual_gelistnode_duality" target="_blank" rel="noopener noreferrer nofollow ugc">NodeData</a> for an example.</p>
<p dir="auto">In your code, you should also check if the first tag is really your tag and not any other tag.</p>
<p dir="auto">best wishes,<br />
Sebastian</p>
]]></description><link>http://developers.maxon.net/forum//post/58062</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/58062</guid><dc:creator><![CDATA[s_bach]]></dc:creator><pubDate>Fri, 19 Apr 2019 15:36:03 GMT</pubDate></item></channel></rss>