Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

acedSSGet(”X”, NULL, NULL, &ent1, ss)

391 views
Skip to first unread message

d00_ape

unread,
Aug 23, 2004, 10:33:09 AM8/23/04
to
I would like to select an entity by its name. Se the following code:

//***********************************************************
ads_name ss;
ads_name ent0, ent1;
struct resbuf *entdata;

if (acdbEntNext(NULL, ent0) != RTNORM) {
acdbFail("Drawing is empty\n"); // Does NOT happen
}
do {
// Get entity's definition data.
entdata = acdbEntGet(ent0);
if (entdata == NULL) {
acutPrintf("Failed to get entity\n");
}

int ret = 0;
// ************ THIS DOESN’T WORK
if( ret = acedSSGet("X", NULL, NULL, entdata, ss) != RTNORM)
{
acutPrintf("\nUnable get entity to selection set, ret = %d", ret );
}

acutRelRb(entdata); // Release the list.
ads_name_set(ent0, ent1); // Bump the name.

} while (acdbEntNext(ent1, ent0) == RTNORM);
//***********************************************************

Why doesn’t the entity become selected in each loop?
I got the return value: ret = 1.

Pleased for help

Zatopek

unread,
Aug 23, 2004, 3:08:29 PM8/23/04
to
I guess that the if looks if ret is something, try a parenthesis.

if( (ret = acedSSGet("X", NULL, NULL, entdata, ss)) != RTNORM)

"d00_ape" <nos...@address.withheld> wrote in message
news:10147713.109327161...@jiveforum2.autodesk.com...

d00_ape

unread,
Aug 24, 2004, 2:22:57 AM8/24/04
to
No same problem...

How to do if I wnt to select an entity form its name, handle or someting.

In the end I want to iterate through all enteties and make a selection of each of them.

Thanks

rex12

unread,
Aug 24, 2004, 3:07:32 AM8/24/04
to
what do you want to do with all that entitis ??

coz if you have the handle or name of entity then you have all you need to
open it an do wathever you want with it.

Regards
Rex

"d00_ape" <nos...@address.withheld> schrieb im Newsbeitrag
news:20856730.109332860...@jiveforum1.autodesk.com...

d00_ape

unread,
Aug 24, 2004, 3:29:36 AM8/24/04
to
I’m working on a project that uses AutoCad API to call an ActiveX in AutoCad. I’m using ObjectARX and there is what I want to do:

1. I have an AutoCad drawing.

2. I want to iterate through all entities in the drawing and make a selection of each of them.

3. Call this function from ActiveX-API:
IControl::Convert(LPDISPATCH pSelection, LPCTSTR bsFilename)
the pSelection is of type: IAcadSelectionSet (AutoCad API)

4. At this time I do this call:
myIcadSelSet = IcadDoc.GetActiveSelectionSet();
to get the active selection set, which I get when calling:
ret = acedSSGet("A", NULL, NULL, NULL, ss)

5. But when I call:
ret = acedSSAdd(ent0, ss, ss)

it doesn’t become the active selection set.
Pleased for all tips how to solve my problem.

For e.g. can I, in some way, convert between these tow types:

ads_name (ObjectARX type)
and
IAcadSelectionSet (AutoCad API)

rex12

unread,
Aug 24, 2004, 11:25:08 AM8/24/04
to
If i have right understund you, you want to do some things with entitis in
drawing trough ActiveX (COM).
Im dont code with COM in C++, so i my be wrong, but you could create your
selectionset trogh COM too, not using ObjectARX.
The SelectionSet Object have a function Select where you can give an otipn
to select all objects. This way you wold become ActiveX SelectionSet with
all entitis. Look for ActiveX and VBA reference in Autocad Help.
There you have all you need about ActiveX in Autocad.

Regards
Rex


"d00_ape" <nos...@address.withheld> schrieb im Newsbeitrag

news:4866587.109333260...@jiveforum1.autodesk.com...

d00_ape

unread,
Aug 24, 2004, 2:49:13 PM8/24/04
to
The thing is I will select each of the enteties one at the time.

pseudo:
for( int i = 0; i < size; i++ )
{
myISelectionSet.Select( i );
// do stuff with myISelectionSet
}

0 new messages