ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem in displaying grip selection

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
274 Views, 3 Replies

Problem in displaying grip selection

Hi ,

I am taking grip selection using "acedSSGetFirst" function. Them I am setting grip programmatically using by using “ads_sssetfirst“

Following is related code:

bool functest(ads_name ss)
// ss is implied grip selection I have got using "acedSSGetFirst"
{
long sslen;
ads_name newSelection;
ads_name ent;
ads_sslength(ss, &sslen);

for (long i=0L; i < sslen ; i++)
{
ads_ssname(ss, i, ent);
ads_ssadd(ent,NULL ,newSelection);
}

if (ads_sssetfirst(newSelection,newSelection) != RTNORM)
{
ads_printf(" Alert !!");
return false;
}

return true;
}

The “ads_sssetfirst: function returns “RTNORM” but I am not able to see the entities in grip selection as AutoCAD normally displays grip selected entities.

I have again make a call to “ads_ssgetfirst” for implied grip selection and it gives me selection. From that I can infer that it is a problem of displaying grip selection.

Can anyone help me to fix it ??
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Hi,
acedSSGetFirst is used to create a pickfirst set. Entity in pickfirst set
are gripped.
I always call acedSSGetFirst(NULL,NULL) before any valid acedSSGetFirst
calling. I got this idea from previous posts in this newsgroup and i don't
know the reason.
Maybe this can help you.

Thanks
-Jerry

дÈëÏûÏ¢ÐÂÎÅ:5074076@discussion.autodesk.com...
Hi ,

I am taking grip selection using "acedSSGetFirst" function. Them I am
setting grip programmatically using by using ¡°ads_sssetfirst¡°

Following is related code:

bool functest(ads_name ss)
// ss is implied grip selection I have got using "acedSSGetFirst"
{
long sslen;
ads_name newSelection;
ads_name ent;
ads_sslength(ss, &sslen);

for (long i=0L; i < sslen ; i++)
{
ads_ssname(ss, i, ent);
ads_ssadd(ent,NULL ,newSelection);
}

if (ads_sssetfirst(newSelection,newSelection) != RTNORM)
{
ads_printf(" Alert !!");
return false;
}

return true;
}

The ¡°ads_sssetfirst: function returns ¡°RTNORM¡± but I am not able to see
the entities in grip selection as AutoCAD normally displays grip selected
entities.

I have again make a call to ¡°ads_ssgetfirst¡± for implied grip selection
and it gives me selection. From that I can infer that it is a problem of
displaying grip selection.

Can anyone help me to fix it ??
Message 3 of 4
Anonymous
in reply to: Anonymous

One problem that I see is that you're ads_ssadd() call will be creating a
new selection set for each iteration of the loop and all but the last one
will be lost which will eventually use up selection sets. And, only the
last entity from the ss selection set will end up in the selection set that
is passed to ads_sssetfirst().

wrote in message news:5074076@discussion.autodesk.com...
Hi ,

I am taking grip selection using "acedSSGetFirst" function. Them I am
setting grip programmatically using by using "ads_sssetfirst"

Following is related code:

bool functest(ads_name ss)
// ss is implied grip selection I have got using "acedSSGetFirst"
{
long sslen;
ads_name newSelection;
ads_name ent;
ads_sslength(ss, &sslen);

for (long i=0L; i < sslen ; i++)
{
ads_ssname(ss, i, ent);
ads_ssadd(ent,NULL ,newSelection);
}

if (ads_sssetfirst(newSelection,newSelection) != RTNORM)
{
ads_printf(" Alert !!");
return false;
}

return true;
}

The "ads_sssetfirst: function returns "RTNORM" but I am not able to see the
entities in grip selection as AutoCAD normally displays grip selected
entities.

I have again make a call to "ads_ssgetfirst" for implied grip selection and
it gives me selection. From that I can infer that it is a problem of
displaying grip selection.

Can anyone help me to fix it ??
Message 4 of 4
Anonymous
in reply to: Anonymous

Hi Art,
I have found the cause of the problem with the help of your valuable finding ..
After using "ads_ssadd(ent ,newSelection, newSelection );"
my problem gets fixed.

Once again thanks a lot for helping me.

Regards,
KIMI

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report