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
findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
Is there a way to findout that AcDbBlockTableRecord is dynamic block except of iterating it?
thanks in advance
moshe
Solved! Go to Solution.
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Alexander,
thanx for your reply.
but that not what i'm asking, i what to know if AcDbBlockTableRecord is dynamic?
let's say i have in database some old blocks version in AcDbBlockTable and i want to upgrade them to a new
version which is dynamic. with AcDbDynBlockReference::isDynamicBlock() i have to catch one
block reference and check it...but what if there isn't any insert? should i do a dummy insert to check it?
that's sounds unlogic.
Moshe
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Moshe-A wrote:
Alexander,
but what if there isn't any insert? should i do a dummy insert to check it?
No. This method is static. That is why you can use it same way:
AcDbObjectId idBTR; // id of BlockTableRecord
if (AcDbDynBlockReference::isDynamicBlock(idBTR)) {
acutPrintf(_T("\nBlock is dynamic"));
} else {
acutPrintf(_T("\nBlock is not dynamic"));
}
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
i'm sorry Alex, you are right, my mistake
thank you
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Alexander,
wait...
In order to be able to use -> AcDbDynBlockReference::isDynamicBlock(AcDbObjectId blockTableRecordId);
first you need to construct AcDbDynBlockReference with AcDbBlockReference object as an argument
AcDbDynBlockReference(AcDbBlockReference* pRef);
AcDbDynBlockReference(AcDbObjectId blockRefId);
so this send me back to start, Am i right?
moshe
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
NO! NO! NO!
Are you know how to call static method of class? OK. Full sample:
static void CheckDynBlock(void)
{
ACHAR blockName[512];
if (acedGetString(TRUE,_T("\nBlock name: "), blockName) == RTNORM) {
AcDbBlockTableRecordPointer pBTR(blockName, acdbCurDwg(), AcDb::kForRead);
if (pBTR.openStatus() == Acad::eOk) {
if (AcDbDynBlockReference::isDynamicBlock(pBTR->objec tId())) {
acutPrintf(_T("\nBlock <%s> is dynamic."), blockName);
} else {
acutPrintf(_T("\nBlock <%s> is not dynamic."), blockName);
}
} else {
acutPrintf(_T("\nCan not open block <%s>. Error: <%s>"),
blockName, acadErrorStatusText(pBTR.openStatus()));
}
}
}
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
got it, thank you
Re: findout dynamic block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content



