Message 1 of 10
AcDbDatabase::insert( )
Not applicable
01-30-2002
08:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone give me an example of this? I'm trying to use the first version
of this:
Acad::ErrorStatus insert(AcDbObjectId& blockId,
const char* pBlockName,
AcDbDatabase* pDb,
bool preserveSourceDatabase = true);
Here is the actual function call:
pCurDb->insert(objId, "chair18", pDbSource);
In case you're not familiar with those arguments, here's what they are:
AcDbObjectId& blockId - output the ID of the block that this function
inserts in your current database.
const char* pBlockName - input the name of the block to be used by the
new block table record in your current database
AcDbDatabase* pDb - input pointer to the source database that contains
the block you wanna read in
preserveSourceDatabase - boolean that determines whether the block read
in is retained in the source database
In my function call, pDbSource is a database that contains just that single
block. When i execute this, however, AutoCAD prints out "Block chair18
references itself" on the command prompt, and does not insert anything.
I also tried to send it some other random string instead of sending
"chair18" as the block name:
pCurDb->insert(objId, "randomString", pDbSource);
In this situation, the block IS read into my current DB. No references are
added in the drawing. When i type in "INSERT" at the command prompt,
"chair18" now shows up as a block that is available to be inserted (rather
than a "randomString" block, as i would expect). I could use the newly
inserted block to programatically insert a reference in my drawing at this
point. I'd really rather not just stick with the "oh well, it works - why
ask questions?" mentality, though - can anyone give me some insight as to
what the heck is going on?
of this:
Acad::ErrorStatus insert(AcDbObjectId& blockId,
const char* pBlockName,
AcDbDatabase* pDb,
bool preserveSourceDatabase = true);
Here is the actual function call:
pCurDb->insert(objId, "chair18", pDbSource);
In case you're not familiar with those arguments, here's what they are:
AcDbObjectId& blockId - output the ID of the block that this function
inserts in your current database.
const char* pBlockName - input the name of the block to be used by the
new block table record in your current database
AcDbDatabase* pDb - input pointer to the source database that contains
the block you wanna read in
preserveSourceDatabase - boolean that determines whether the block read
in is retained in the source database
In my function call, pDbSource is a database that contains just that single
block. When i execute this, however, AutoCAD prints out "Block chair18
references itself" on the command prompt, and does not insert anything.
I also tried to send it some other random string instead of sending
"chair18" as the block name:
pCurDb->insert(objId, "randomString", pDbSource);
In this situation, the block IS read into my current DB. No references are
added in the drawing. When i type in "INSERT" at the command prompt,
"chair18" now shows up as a block that is available to be inserted (rather
than a "randomString" block, as i would expect). I could use the newly
inserted block to programatically insert a reference in my drawing at this
point. I'd really rather not just stick with the "oh well, it works - why
ask questions?" mentality, though - can anyone give me some insight as to
what the heck is going on?

