AcDbBlockTableRecord

AcDbBlockTableRecord

Anonymous
Not applicable
1,789 Views
5 Replies
Message 1 of 6

AcDbBlockTableRecord

Anonymous
Not applicable
//---------------------failed-------------------
AcDbBlockTableRecord* pRecord=new AcDbBlockTableRecord;
acdbOpenAcDbEntity(pEnt, ObjectId, AcDb::kForWrite);
pRecord->appendAcDbEntity(pEnt);
//------------------------success------
pEnt=new AcDbCircle(AcGePoint3d(0,0,0),AcGeVector3d::kZAxis,100);
pRecord->appendAcDbEntity(pEnt);
//----------------------------------------------
why?
if pEnt reference to a entity in model space of database,the function appendAcDbEntity() failed???
0 Likes
1,790 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
I'll guess that it is because you can't append an entity
to a block table record that itself has not been added
to the database/blocktable.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:[email protected]...
//---------------------failed-------------------
AcDbBlockTableRecord* pRecord=new AcDbBlockTableRecord;
acdbOpenAcDbEntity(pEnt, ObjectId, AcDb::kForWrite);
pRecord->appendAcDbEntity(pEnt);
//------------------------success------
pEnt=new AcDbCircle(AcGePoint3d(0,0,0),AcGeVector3d::kZAxis,100);
pRecord->appendAcDbEntity(pEnt);
//----------------------------------------------
why?
if pEnt reference to a entity in model space of database,the function appendAcDbEntity() failed???
0 Likes
Message 3 of 6

Anonymous
Not applicable
In addition to what Tony said, If I understand correctly, you're trying to
add an entity to two different block table records. Since entities can have
only one owner, this would not be legal and I would expect
appendAcDbEntity() to fail. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 4 of 6

Anonymous
Not applicable
Duh - I completely overlooked that 🙂

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Owen Wengerd" wrote in message news:[email protected]...
In addition to what Tony said, If I understand correctly, you're trying to
add an entity to two different block table records. Since entities can have
only one owner, this would not be legal and I would expect
appendAcDbEntity() to fail. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 5 of 6

Anonymous
Not applicable
After Owen's clarifying what it is you're
actually doing, I think what you want is
AcDbBlockTableRecord::assumeOwnershipOf()

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:[email protected]...
//---------------------failed-------------------
AcDbBlockTableRecord* pRecord=new AcDbBlockTableRecord;
acdbOpenAcDbEntity(pEnt, ObjectId, AcDb::kForWrite);
pRecord->appendAcDbEntity(pEnt);
//------------------------success------
pEnt=new AcDbCircle(AcGePoint3d(0,0,0),AcGeVector3d::kZAxis,100);
pRecord->appendAcDbEntity(pEnt);
//----------------------------------------------
why?
if pEnt reference to a entity in model space of database,the function appendAcDbEntity() failed???
0 Likes
Message 6 of 6

Anonymous
Not applicable
I see!
thank you!
by the way,I don't know how to create a picture box to preview a block.for example the command INSERT will call out a dialog which have a picture box show the block thumbnail currently selected.
0 Likes