Autodesk ObjectARX
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Guys,
In my application i have three block symbols contains some attributes. the current task i'm working on
is converting an old version of these blocks (the new version also are dynamic blocks)
let's say i have a host database that has a xref in and the xref contains the old blocks.
i scan the current database (AcDbBlockTableRecord) for that xref, open it and scan the xref database (AcDbBlockTableRecord) for those blocks it turn i find each block make an update insert (insert= from outside database) and replace each AcDbBlockReference. this all process work fine except the attributes at first are places
on the 0,0 position. after audit the xref and regen it, the attributes are restores in place were they should be.
would like to mention that i did not encounter this problem when i insert the blocks in the current database
or even replacing the symbols inside a standard block.
Any one knows what is my problem?
thanks in advance
moshe
Solved! Go to Solution.
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
foregot to mention that audit results no errors
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Have you tried setting the database current before adding the attributes?
Owen Wengerd
ManuSoft
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Owen,
NO
What do you mean by that? to set the Xref database current?
can i do that without closing the host database?
thanx
Moshe
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Yes, and yes.
Owen Wengerd
ManuSoft
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
tried it and it still doesn't work, hope i use it good (cause i have never used AcApDocumentManager)
here's what i did
ACHAR XrefFile[32= = _T("xref.dwg");
AcDbDatabase *pXref = NULL;
// allocating memory
pXref = new AcDbDatabase(Adesk::kFalse);
pXref->readDwgFile(XrefFile); {
// switch databases
acDocManager->setCurDocument(acDocManager->documen t(pXref));
replace_old_symbols(pXref); // real work
// restore current database
acDocManager->setCurDocument(acDocManager->documen t(pCurDwg));
pXref->saveAs(XrefFile);
delete pXref; // dispose memory
i would like to understand why is this happends - do you have explanation?
Moshe
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Owen,
here's a simple test is did:
i draw a rectangle on the current database (with RECTANGLE command)
disable the call to restore the current database
// acDocManager->setCurDocument(acDocManager->documen
then build & load & run my application again
then i tried to select the rectangle and i did successed
i thought if the xref database is current i won't be able to select objects in pCurDwg
is this means that the call
acDocManager->setCurDocument(acDocManager->documen
is not acutally done?
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try instead AcDbHostApplicationServices::setWorkingDatabase().
Owen Wengerd
ManuSoft
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hallelujah!
it's working fine
thank you very much owen
i'm sure you have explanation to this and i understand it's related to display and graphics
but why does this happends only to attributes?
Moshe
Re: attributes are placed in 0,0 position
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I can only speculate that calculating text position after an alignment change requires information from the working database, and that the process is intentionally skipped or fails for some reason when the working database is different from the database of the target text object.
Owen Wengerd
ManuSoft
