<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Objects With Dependencies And Filing in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8206135#M6259</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to explain this as short and exact as I can.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My tool contains various custom objects that depend on each other. So I am inserting them in the right order. When I am saving my drawing and try to reopen it, the dwginfields Methods of the objects get called in a different order, so that my objects cannot be initiated completely. I am trying to use an AcRxEventReactor with the Event&amp;nbsp;initialDwgFileOpenComplete to complete my initiation there, but I encounter two huge problems:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Somehow my Reactor detaches itself after I closed all open Drawings (but the AutoCAD application is still running). I use&amp;nbsp;autoInitAndRelease = true.&lt;/LI&gt;&lt;LI&gt;I need to store lists of my objects, that I depend on, per document. How can I achieve this in DBX since there is no document class available?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I am open for other ideas to get the saving and loading done with dependencies. Maybe I can change the order in which dwginfields methods are called, but I couldn't find a way.&lt;/P&gt;&lt;P&gt;I would appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Christine&lt;/P&gt;</description>
    <pubDate>Fri, 17 Aug 2018 09:04:14 GMT</pubDate>
    <dc:creator>christineweiss86</dc:creator>
    <dc:date>2018-08-17T09:04:14Z</dc:date>
    <item>
      <title>Custom Objects With Dependencies And Filing</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8206135#M6259</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to explain this as short and exact as I can.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My tool contains various custom objects that depend on each other. So I am inserting them in the right order. When I am saving my drawing and try to reopen it, the dwginfields Methods of the objects get called in a different order, so that my objects cannot be initiated completely. I am trying to use an AcRxEventReactor with the Event&amp;nbsp;initialDwgFileOpenComplete to complete my initiation there, but I encounter two huge problems:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Somehow my Reactor detaches itself after I closed all open Drawings (but the AutoCAD application is still running). I use&amp;nbsp;autoInitAndRelease = true.&lt;/LI&gt;&lt;LI&gt;I need to store lists of my objects, that I depend on, per document. How can I achieve this in DBX since there is no document class available?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I am open for other ideas to get the saving and loading done with dependencies. Maybe I can change the order in which dwginfields methods are called, but I couldn't find a way.&lt;/P&gt;&lt;P&gt;I would appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Christine&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 09:04:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8206135#M6259</guid>
      <dc:creator>christineweiss86</dc:creator>
      <dc:date>2018-08-17T09:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Objects With Dependencies And Filing</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8209007#M6260</link>
      <description>&lt;P&gt;@1: What do you mean by "the reactor detaches itself"? Do you mean, that &lt;FONT face="courier new,courier"&gt;initialDwgFileOpenComplete()&lt;/FONT&gt; won't be called for any new document after you closed all docs? Is the destructor of your &lt;FONT face="courier new,courier"&gt;AcRxEventReactor&lt;/FONT&gt; called?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@2: You could use a &lt;FONT face="courier new,courier"&gt;std::map&amp;lt;AcDbDatabase*, MyDocData&amp;gt;&lt;/FONT&gt; in your DBX to map your document data to an &lt;FONT face="courier new,courier"&gt;AcDbDatabase&lt;/FONT&gt; like this:&lt;/P&gt;
&lt;PRE&gt;std::map&amp;lt;AcDbDatabase*, MyDocData&amp;gt; DocDataMap;

void f(AcDbEntity *ent)
{
     MyDocData &amp;amp;data = DocDataMap[ent-&amp;gt;database()];
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Aug 2018 21:05:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8209007#M6260</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2018-08-18T21:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Objects With Dependencies And Filing</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8210885#M6261</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thank you very much for your help! I am now using the&amp;nbsp;databaseConstructed method to create a new entry in my map and I am storing this map in a static class that all my custom entities that need data from the ElementContainer have access to:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;databaseConstructed(AcDbDatabase* pDatabase) {
   PProDocManager::pElementContainer[pDatabase] = new PProElementContainer();
}&lt;/PRE&gt;&lt;PRE&gt;class PProDocManager
{
public:
	 static std::map&amp;lt;AcDbDatabase*,PProElementContainer*&amp;gt; pElementContainer;
public:	 
	 ~PProDocManager(void);

	 static PProElementContainer* getpElementContainer(AcDbDatabase* pDatabase);
private:
	 PProDocManager(void);
};&lt;/PRE&gt;&lt;PRE&gt;#include "stdafx.h"
#include "PProDocManager.h"

std::map&amp;lt;AcDbDatabase*,PProElementContainer*&amp;gt; PProDocManager::pElementContainer;

PProDocManager::PProDocManager(void)
{
}


PProDocManager::~PProDocManager(void)
{
}


PProElementContainer* PProDocManager::getpElementContainer(AcDbDatabase* pDatabase) {
	 std::map&amp;lt;AcDbDatabase*, PProElementContainer*&amp;gt;::const_iterator iterMap = pElementContainer.find(pDatabase);
	 //Element found
	 if(iterMap != pElementContainer.end()) {
		  return iterMap-&amp;gt;second;
	 }
	 else {
		  return nullptr;
	 }
}&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;The problem with the EventReactor is gone. Maybe it was a&amp;nbsp;consecutive fault caused by my other problems in the code.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thanks again!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 12:19:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8210885#M6261</guid>
      <dc:creator>christineweiss86</dc:creator>
      <dc:date>2018-08-20T12:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Objects With Dependencies And Filing</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8250283#M6263</link>
      <description>&lt;P&gt;This is work fine&amp;nbsp;&lt;A title="https://www.welookups.com" href="https://www.welookups.com" target="_blank"&gt;https://www.welookups.com&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;#include "stdafx.h"
#include "PProDocManager.h"

std::map&amp;lt;AcDbDatabase*,PProElementContainer*&amp;gt; PProDocManager::pElementContainer;

PProDocManager::PProDocManager(void)
{
}


PProDocManager::~PProDocManager(void)
{
}


PProElementContainer* PProDocManager::getpElementContainer(AcDbDatabase* pDatabase) {
	 std::map&amp;lt;AcDbDatabase*, PProElementContainer*&amp;gt;::const_iterator iterMap = pElementContainer.find(pDatabase);
	 //Element found
	 if(iterMap != pElementContainer.end()) {
		  return iterMap-&amp;gt;second;
	 }
	 else {
		  return nullptr;
	 }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 15:34:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-objects-with-dependencies-and-filing/m-p/8250283#M6263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-06T15:34:05Z</dc:date>
    </item>
  </channel>
</rss>

