<?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 Re: Base point in associative array in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5288433#M11981</link>
    <description>&lt;P&gt;Please help me !&amp;nbsp;This problem is difficult with me !&lt;/P&gt;</description>
    <pubDate>Mon, 22 Sep 2014 02:59:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-09-22T02:59:23Z</dc:date>
    <item>
      <title>Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5264131#M11972</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was created array entity by array command of autocad.I used LI command , return base point ,for example is A point. Then i edit it ; i set base point is a new value , and I used LI command , return base point is no change.How is base point ? How to get base point ? ( i used&amp;nbsp;AcDbAssocArrayActionBody::getSourceBasePoint ,just return that A point )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2014 01:56:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5264131#M11972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-10T01:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5271689#M11973</link>
      <description>&lt;P&gt;Array (associative) is a sample of AcDbBlockReference class. So you have to use AcDbBlockReference::position method.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2014 17:41:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5271689#M11973</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2014-09-12T17:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5272519#M11974</link>
      <description>&lt;P&gt;Thanks for your reply !&lt;/P&gt;&lt;P&gt;But I just&amp;nbsp;retrieve a point :AcGePoint3d(0,0,0) when used that method :&amp;nbsp;&lt;/P&gt;&lt;DIV class="Element5"&gt;AcDbBlockReference::position&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Sep 2014 02:16:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5272519#M11974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-13T02:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5272715#M11975</link>
      <description>&lt;P&gt;Without your's code I can not find bug in it. Compare two pictures:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/124719i1D11F4C6476EDE1D/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="2014-09-13_12-38-12.png" title="2014-09-13_12-38-12.png" align="middle" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/124721i8523C27B32BBF6FA/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="2014-09-13_12-39-05.png" title="2014-09-13_12-39-05.png" align="middle" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2014 09:42:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5272715#M11975</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2014-09-13T09:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5272729#M11976</link>
      <description>&lt;P&gt;Also this topic and sample can help you: &lt;A href="http://forums.autodesk.com/t5/objectarx/associative-array/td-p/4343871" target="_blank"&gt;http://forums.autodesk.com/t5/objectarx/associative-array/td-p/4343871&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2014 10:05:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5272729#M11976</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2014-09-13T10:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5273809#M11977</link>
      <description>&lt;P&gt;Thanks you !&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want say about Array Path ; I changed continue base point but Geometry ( Base X , Base Y , Base Z) not changed!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2014 01:49:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5273809#M11977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-15T01:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5274751#M11978</link>
      <description>&lt;P&gt;Try to explain your's problem in more detail with code, images, dwg-file. Otherwise you'll never get help.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2014 13:42:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5274751#M11978</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2014-09-15T13:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5276323#M11979</link>
      <description>&lt;P&gt;I'm sorry ! This is my problem .User draw one array path&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source is a line : start point (X=&amp;nbsp;19.5580 &amp;nbsp;Y= &amp;nbsp;11.8961 &amp;nbsp;Z= &amp;nbsp; 0.0000) &amp;nbsp;; end point (&amp;nbsp;X= &amp;nbsp;17.7793 &amp;nbsp;Y= &amp;nbsp; 8.2770 &amp;nbsp;Z= &amp;nbsp; 0.0000)&lt;/P&gt;&lt;P&gt;Path is a line : start point (X= &amp;nbsp;26.9032 &amp;nbsp;Y= &amp;nbsp;12.3896 &amp;nbsp;Z= &amp;nbsp; 0.0000 ) ; end point ( X= &amp;nbsp;22.5554 &amp;nbsp;Y= &amp;nbsp; 7.5861 &amp;nbsp;Z= &amp;nbsp; 0.0000 )&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/125089i83B9AD2B0E56A7EE/image-size/original?v=mpbl-1&amp;amp;px=-1" align="center" title="Untitled.png" alt="Untitled.png" /&gt;&lt;IMG border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/125091iFCD9EB089FC46968/image-size/original?v=mpbl-1&amp;amp;px=-1" align="center" title="Untitled1.png" alt="Untitled1.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 02:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5276323#M11979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-16T02:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5276391#M11980</link>
      <description>&lt;P&gt;Now , i'll read that array path .&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;AcDbObjectId networkId = AssocUtils::getAssocNetwork(false, UtilFunctions::getBlockRecordId(ACDB_MODEL_SPACE));	
	if(networkId != AcDbObjectId::kNull)
	{				
		AcDbObjectPointer&amp;lt;AcDbAssocNetwork&amp;gt; pNetwork(networkId, kForRead);				
		if (pNetwork.openStatus() != eOk)
			return false;
		const AcDbObjectIdArray&amp;amp; actionsInNetwork = pNetwork-&amp;gt;getActions();
		for (int nCount = 0; nCount &amp;lt; actionsInNetwork.length(); nCount++)
		{
			const AcDbObjectId&amp;amp; actionId = actionsInNetwork[nCount];
			if (actionId == AcDbObjectId::kNull)
				continue;
			AcDbObjectPointer&amp;lt;AcDbAssocAction&amp;gt; pAction(actionId, kForRead);
			if (pAction.openStatus() != eOk)
				continue;
			AcDbAssocAction *pAcation = pAction.object();
			AcDbObjectId id = pAcation-&amp;gt;actionBody();
			AcDbHardOwnershipId OwnershipId (id);
			
			AcDbObjectPointer&amp;lt;AcDbObject&amp;gt;pObj(OwnershipId,AcDb::kForWrite);
			CString s = pObj-&amp;gt;isA()-&amp;gt;name();
			/////////////
			const AcDbAssocArrayActionBody *pArrayActionBody = AcDbAssocArrayActionBody::cast(pObj);
			const AcDbAssocArrayParameters *pArrayParameters = pArrayActionBody-&amp;gt;parameters();
			AcDbObjectIdArray ids = pArrayActionBody-&amp;gt;getSourceEntities();
			AcDbObjectPointer&amp;lt;AcDbEntity&amp;gt; pEnt(ids[0],AcDb::kForWrite);
			AcDbLine *pline = AcDbLine::cast(pEnt);
			AcGePoint3d startP = pline-&amp;gt;startPoint();
			AcGePoint3d EndP = pline-&amp;gt;endPoint();
			AcDbVertexRef vertexRef ;
			AcGePoint3d position;
			es = pArrayActionBody-&amp;gt;getSourceBasePoint(vertexRef,position);



		}
	}		&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I get source entities .It is not &lt;SPAN&gt;origin&amp;nbsp;&lt;/SPAN&gt;source entities ! Because ( startP , EndP ) are other values .How do I can get correct source entities ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Is correct the path to get AcDbAssocArrayActionBody ? It is begin at getAssocNetwork ,etc ...&lt;/P&gt;&lt;P&gt;And I get the base point (X= &amp;nbsp;22.5554 &amp;nbsp;Y= &amp;nbsp; 7.5861 &amp;nbsp;Z= &amp;nbsp; 0.0000) .Base point is position !&lt;/P&gt;&lt;P&gt;Temporary forget source entities is not correct . Now I'll redraw that array path .&lt;/P&gt;&lt;PRE&gt;AcDbLine *pPath = new AcDbLine(AcGePoint3d( 26.9032 , 12.3896 , 0.0000),AcGePoint3d(22.5554 ,  7.5861  ,  0.0000));
	AcDbLine *pSource = new AcDbLine(AcGePoint3d( 19.5580 ,  11.8961  ,   0.0000),AcGePoint3d(17.7793 ,  8.2770 ,  0.0000));
	AcDbObjectId idSource = UtilFunctions::postToDb(pSource);
	AcDbObjectId idPath = UtilFunctions::postToDb(pPath);
	AcDbObjectIdArray sourceEntites;
	sourceEntites.append(idSource);
	AcDbVertexRef basePoint(AcGePoint3d(22.555400,7.586100,0.000000));
	AcDbEdgeRef edge(pPath);

	double itemSpacing = 4; 
	double rowSpacing = 5.42865; 
	double levelSpacing = 1; 
	int itemCount = 2; 
	int rowCount = 1;
	int levelCount = 1;
	double rowElevation = 0;

	AcDbAssocArrayPathParameters *pPathParameters = new AcDbAssocArrayPathParameters(itemSpacing,rowSpacing,levelSpacing,
		itemCount,rowCount,levelCount,rowElevation);

	pPathParameters-&amp;gt;setPath(edge);
	pPathParameters-&amp;gt;setMethod(AcDbAssocArrayPathParameters::kMeasure);
	pPathParameters-&amp;gt;setPathDirection(false);
	
	AcDbDatabase* pDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
	Acad::ErrorStatus es ;
	AcDbObjectId arrayId; 
	AcDbObjectId actionBodyId;

	es = AcDbAssocArrayActionBody::createInstance (sourceEntites,basePoint,pPathParameters,arrayId,actionBodyId);
	bool k = AcDbAssocManager::evaluateTopLevelNetwork(pDb,NULL,0);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Code for&amp;nbsp;UtilFunctions::postToDb&lt;/P&gt;&lt;PRE&gt;AcDbObjectId postToDb(AcDbEntity* pEnt)
{
	Acad::ErrorStatus es;
	AcDbObjectId objId;
	AcDbBlockTable* pBlockTable = NULL;	
	if (acdbCurDwg()-&amp;gt;getBlockTable(pBlockTable, AcDb::kForRead)== Acad::eOk) 
	{
		AcDbBlockTableRecord*  pSpaceRecord = NULL;		
		CString mode =  acdbCurDwg()-&amp;gt;tilemode() ? ACDB_MODEL_SPACE : ACDB_PAPER_SPACE ;
		es =  pBlockTable-&amp;gt;getAt( ACDB_MODEL_SPACE,pSpaceRecord,AcDb::kForWrite);
		if (es == Acad::eOk) 
		{
			pEnt-&amp;gt;setDatabaseDefaults(acdbCurDwg());
			pSpaceRecord-&amp;gt;appendAcDbEntity(objId, pEnt);
			pEnt-&amp;gt;close();
			pSpaceRecord-&amp;gt;close();						
		}				
		pBlockTable-&amp;gt;close();
	}	
	return objId;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Finally result : It is unlike with origin . Please explain to me , why is ?&lt;/P&gt;&lt;P&gt;Thanks you !&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/125105i298A5EEF8A8B5BE7/image-size/original?v=mpbl-1&amp;amp;px=-1" align="center" title="Untitled2.png" alt="Untitled2.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Sep 2014 03:25:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5276391#M11980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-16T03:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Base point in associative array</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5288433#M11981</link>
      <description>&lt;P&gt;Please help me !&amp;nbsp;This problem is difficult with me !&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 02:59:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/base-point-in-associative-array/m-p/5288433#M11981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-22T02:59:23Z</dc:date>
    </item>
  </channel>
</rss>

