<?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: Adding dimensions in an external database in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101358#M29383</link>
    <description>Gentlemen ?&lt;BR /&gt;
&lt;BR /&gt;
This topic is very important to me. Any answer would help, even if I get an "No, it is impossible to do that." will be very helpful too, because it will get me out from the wrong track and changing to other tracks to begin my new iteration for solutions.&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Horace</description>
    <pubDate>Thu, 12 Aug 2004 13:25:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-08-12T13:25:33Z</dc:date>
    <item>
      <title>Adding dimensions in an external database</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101355#M29380</link>
      <description>Hi,&lt;BR /&gt;
I met a problem when I tried to add dimensions in an external database. To add dimension for a 3d line for example, I want the dimension to lie on the UCS XY plane.&lt;BR /&gt;
&lt;BR /&gt;
I can create an UCS for this line, setting the ucsId for *ACTIVE ViewportTableRecord, but I can't make it current. Can't find a suitable function call to make it current, because the only function I knew is acedVportTableRecords2Vports() but it doesn't work for external database. ie. no way to force update.&lt;BR /&gt;
So the dimension end up lies on the external database's WCS XY plane, which is wrong.&lt;BR /&gt;
&lt;BR /&gt;
Any help would be VERY much appreciated !&lt;BR /&gt;
&lt;BR /&gt;
Horace&lt;BR /&gt;
&lt;BR /&gt;
Horace</description>
      <pubDate>Sat, 07 Aug 2004 07:43:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101355#M29380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-08-07T07:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dimensions in an external database</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101356#M29381</link>
      <description>acedSetCurrentUCS() sets the UCS for the current drawing

via acdbHostApplicationServices()-&amp;gt;setWorkingDatabase(pDb)
you can change the current database

Bernd


"Horace" &lt;NOSPAM&gt; schrieb im Newsbeitrag
news:18620364.1091864616798.JavaMail.jive@jiveforum1.autodesk.com...
&amp;gt; Hi,
&amp;gt; I met a problem when I tried to add dimensions in an external database. To
add dimension for a 3d line for example, I want the dimension to lie on the
UCS XY plane.
&amp;gt;
&amp;gt; I can create an UCS for this line, setting the ucsId for *ACTIVE
ViewportTableRecord, but I can't make it current. Can't find a suitable
function call to make it current, because the only function I knew is
acedVportTableRecords2Vports() but it doesn't work for external database.
ie. no way to force update.
&amp;gt; So the dimension end up lies on the external database's WCS XY plane,
which is wrong.
&amp;gt;
&amp;gt; Any help would be VERY much appreciated !
&amp;gt;
&amp;gt; Horace
&amp;gt;
&amp;gt; Horace&lt;/NOSPAM&gt;</description>
      <pubDate>Mon, 09 Aug 2004 18:44:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101356#M29381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-08-09T18:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dimensions in an external database</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101357#M29382</link>
      <description>Hi, Bernd, &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help, but maybe I haven't got myself understood in English. Let me try again.&lt;BR /&gt;
&lt;BR /&gt;
I knew the acedSetCurrentUCS() function too, but what I need is to set the current UCS for an NON-CURRENT database(it can be external database too) which is opened for processing, code snippet is like this :&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
void AddDimension()&lt;BR /&gt;
{&lt;BR /&gt;
AcDbDatabase *pDb = new AcDbDatabase(true,true); // this is the "NON-CURRENT" database&lt;BR /&gt;
&lt;BR /&gt;
// adding entities omitted for simplify&lt;BR /&gt;
...&lt;BR /&gt;
//&lt;BR /&gt;
// ptLocation,USXaxis,UCSYaxis is a UCS aligned on a 3d line&lt;BR /&gt;
//&lt;BR /&gt;
&lt;BR /&gt;
UCSId = CreateUCS(pDb,ptLocation,USXaxis,UCSYaxis);&lt;BR /&gt;
&lt;BR /&gt;
// set the UCS for pDb by iterating throught the viewport record&lt;BR /&gt;
&lt;BR /&gt;
SetCurrentUCSforExternalDB(pDb,UCSId);&lt;BR /&gt;
&lt;BR /&gt;
// adding dimension to a certain 3d line, for example&lt;BR /&gt;
// the problem is, it falls onto the WCS XY plane, which is wrong, it should be on UCS XY plane.&lt;BR /&gt;
&lt;BR /&gt;
AcDbAlignedDimension *pDim = new AcDbAlignedDimension(...);&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
pDb-&amp;gt;saveAs("test.dwg");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
void SetCurrentUCSforExternalDB(AcDbDatabase *pDb,AcDbObjectId UCSId)&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
 AcDbViewportTable *pVT;&lt;BR /&gt;
 &lt;BR /&gt;
 es=pDb-&amp;gt;getViewportTable(pVT,AcDb::kForRead);&lt;BR /&gt;
 if (es != Acad::eOk)&lt;BR /&gt;
 {&lt;BR /&gt;
  acutPrintf("\nFailed to get vport table");&lt;BR /&gt;
  pVT-&amp;gt;close();&lt;BR /&gt;
  return;&lt;BR /&gt;
 }&lt;BR /&gt;
 AcDbViewportTableIterator* pIter = NULL;&lt;BR /&gt;
 es=pVT-&amp;gt;newIterator(pIter);&lt;BR /&gt;
 if (es != Acad::eOk)&lt;BR /&gt;
 {&lt;BR /&gt;
  acutPrintf("\nFailed to get vport table");&lt;BR /&gt;
  pVT-&amp;gt;close();&lt;BR /&gt;
  delete pIter;&lt;BR /&gt;
  return;&lt;BR /&gt;
 }&lt;BR /&gt;
 for (pIter-&amp;gt;start();!pIter-&amp;gt;done();pIter-&amp;gt;step())&lt;BR /&gt;
 {&lt;BR /&gt;
  AcDbViewportTableRecord* pRec;&lt;BR /&gt;
  es=pIter-&amp;gt;getRecord(pRec,AcDb::kForWrite); //it should be open for write mode&lt;BR /&gt;
  if (es != Acad::eOk)&lt;BR /&gt;
  {&lt;BR /&gt;
   acutPrintf("\nFailed to get vport table record");&lt;BR /&gt;
   pVT-&amp;gt;close();&lt;BR /&gt;
   pRec-&amp;gt;close();&lt;BR /&gt;
   delete pIter;&lt;BR /&gt;
   return;&lt;BR /&gt;
  }&lt;BR /&gt;
  char* name=NULL;&lt;BR /&gt;
  es=pRec-&amp;gt;getName(name);&lt;BR /&gt;
  if (es != Acad::eOk)&lt;BR /&gt;
  {&lt;BR /&gt;
   acutPrintf("\nFailed to get name from vport table");&lt;BR /&gt;
   pVT-&amp;gt;close();&lt;BR /&gt;
   pRec-&amp;gt;close();&lt;BR /&gt;
   delete pIter;&lt;BR /&gt;
   return;&lt;BR /&gt;
  }&lt;BR /&gt;
//  acutPrintf("\nname=%s",name);&lt;BR /&gt;
  if (stricmp(name,"*ACTIVE")==0)&lt;BR /&gt;
  {  &lt;BR /&gt;
   es=pRec-&amp;gt;setUcs(UCSId);&lt;BR /&gt;
//   pRec-&amp;gt;setUcsPerViewport(true);&lt;BR /&gt;
  }&lt;BR /&gt;
  es=pRec-&amp;gt;close();&lt;BR /&gt;
// the following doesn't apply to pDb, which is wrong&lt;BR /&gt;
// it updates the current database, but is not what I wanted&lt;BR /&gt;
// how can I force pDb to update ?&lt;BR /&gt;
  es = acedVportTableRecords2Vports(); // force update&lt;BR /&gt;
 }&lt;BR /&gt;
 es=pVT-&amp;gt;close();&lt;BR /&gt;
 delete pIter;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
I hope this explains. the problem I had was : I couldn't find a function call that can force the UCS update in pDb.&lt;BR /&gt;
&lt;BR /&gt;
So after these, the dimensions I added all lie onto the WCS XY plane, instead of UCS XY plane.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Horace</description>
      <pubDate>Tue, 10 Aug 2004 02:58:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101357#M29382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-08-10T02:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dimensions in an external database</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101358#M29383</link>
      <description>Gentlemen ?&lt;BR /&gt;
&lt;BR /&gt;
This topic is very important to me. Any answer would help, even if I get an "No, it is impossible to do that." will be very helpful too, because it will get me out from the wrong track and changing to other tracks to begin my new iteration for solutions.&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Horace</description>
      <pubDate>Thu, 12 Aug 2004 13:25:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/adding-dimensions-in-an-external-database/m-p/1101358#M29383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-08-12T13:25:33Z</dc:date>
    </item>
  </channel>
</rss>

