AcDbObjectIterator::entity() returns NULL

AcDbObjectIterator::entity() returns NULL

Anonymous
Not applicable
553 Views
2 Replies
Message 1 of 3

AcDbObjectIterator::entity() returns NULL

Anonymous
Not applicable
I am trying to access the Attributes on a blockreference. by the asking of
the AcDbBlockReference::attributeIterator function.
But while iterating over the entities (attributes) thru the
AcDbObjectIterator::entity method, i am getting a null value always...

when i looked for help on the above function in Arx docs... it was as
follows

what is the meaning of "If the entity is database-resident, then NULL " then
how can i access and modify the attributes ?
regards

Vikram


ARX DOC Says:


AcDbObjectIterator::entity Function


AcDbEntity *

entity();

If the entity the iterator is currently positioned on is not
database-resident, then a pointer to the entity will be returned. If the
entity is database-resident, then NULL will be returned. When iterating over
database-resident entities, the AcDbObjectIterator::objectId() method should
be used to obtain the entity's objectId, which can then be used to open the
object.
0 Likes
554 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
A database resident entity (also known as DBR) is one which has been
added to the drawing and closed, therefore handing over responsibility
for the entity to AutoCAD. According to the description of the
function, only an entity that has been created on the stack or on the
heap but not added to the AcDbDatabase would return a valid pointer.

Use the AcDbObjectIterator::objectId() method if you're situation
doesn't meet the above conditions.

|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
| Autodesk Registered Developer
| email: [email protected]
| web site: http://www.cadwerx.net
|
0 Likes
Message 3 of 3

Anonymous
Not applicable
How are you getting the block reference?


I assuming that you are getting blockreference through
AcDbBlockReferenceIdIterator or something similar,you cannot do that.



There 2 ways of doing it-
1. Get a Selection Set Of block references of that name. Then go

2. More modern way of doing it -
getBlockReferenceIds();

cheers.
jay




"Vikram V. Jahagirdar" wrote in message
news:[email protected]...
> I am trying to access the Attributes on a blockreference. by the asking
of
> the AcDbBlockReference::attributeIterator function.
> But while iterating over the entities (attributes) thru the
> AcDbObjectIterator::entity method, i am getting a null value always...
>
> when i looked for help on the above function in Arx docs... it was as
> follows
>
> what is the meaning of "If the entity is database-resident, then NULL "
then
> how can i access and modify the attributes ?
> regards
>
> Vikram
>
>
> ARX DOC Says:
>
>
> AcDbObjectIterator::entity Function
>
>
> AcDbEntity *
>
> entity();
>
> If the entity the iterator is currently positioned on is not
> database-resident, then a pointer to the entity will be returned. If the
> entity is database-resident, then NULL will be returned. When iterating
over
> database-resident entities, the AcDbObjectIterator::objectId() method
should
> be used to obtain the entity's objectId, which can then be used to open
the
> object.
>
>
>
0 Likes