Hi,
I was looking for the same info, and had posted a query just 2-3 bak
regarding the same. But nobody answered.. 😞 anyway...
My question is, little head of this,
In a drawing i have 3 Xrefs. Both refer to the same drawing. Meaning 3
instances of the ONE XRef. But all the Inserts are having different
Xformation. Now in such a case how can I deterince which XRef belong to
which AcDbBlockReference ? or vice versa ?
Is there any 1-1 hard and fast relationship between the AcDbXRefGraphNode -
> AcDbBlockReference ??
Please help.
thanks and regards.
Vikram
"Tony Tanzillo" wrote in message
news:7D723A5C3FB23785D70C1017854C41C7@in.WebX.maYIadrTaRb...
> "Lawrecne" wrote in message
> news:58E0AAB476D28BC03918A9F8CD27CBA3@in.WebX.maYIadrTaRb...
> >
> > pObj = pBlkTblRec->objectId();
> >
> > // how do i open the Object??/
> >
> > }
>
> You're going to have to do a bit more studying of
> the API. The BlockTableRecord object is open (it's
> the variable pBlkTblRec).
>
> The objectId() member is returning the object id
> of the open object, which is not of any use to you
> here.
>
> You have to call getBlockReferenceIds() to get an
> array of ObjectIds of all insertions of the block,
> and then you open each of them:
>
>
> AcDbObjectIdArray ids;
>
> Acad::ErrorStatus es;
>
> es = pBlkTblRec->getBlockReferenceIds(ids, true, true);
>
> if( es != Acad::eOk )
> return es;
>
> for(int i = 0; i < ids.length(); i++ )
> {
> AcDbBlockReference* pBlockRef = NULL;
>
> es = acdbOpenObject(pBlockRef, ids, AcDb::kForRead);
>
> if( es == Acad::eOk && pBlockRef != NULL )
> {
> AcGePoint3d inspt(pBlockRef->position());
> acutPrintf("\n X: %0.2f Y: %0.2f Z: %0.2f",
> inspt[0], inspt[1], inspt[2]);
>
> // do other stuff with pBlockRef, then close it
>
> pBlockRef->close();
> }
> }
>
>
>
>
>
>
>