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

acedSSSetFirst returns always an error

2 REPLIES 2
Reply
Message 1 of 3
Robert-
325 Views, 2 Replies

acedSSSetFirst returns always an error

Hello,



I want to highlight and grip some entities. I created a test command which should highlight and grip the last added entity of the acad database.

Here is the code:


ads_name SelName;

int b = acedSSGet("L", NULL, NULL, NULL, SelName);

long len;

acedSSLength(SelName, &len);

int a = acedSSSetFirst(SelName, SelName);



acedSSGetFirst succeeded, but acedSSSetFirst returns always 5001 (error). Why?

In addCommand of this command the two important flags ACRX_CMD_USEPICKSET | ACRX_CMD_REDRAW are set.



Hope somebody could help me!


with kind regards,

Robert
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Robert-

> I want to highlight and grip some entities. I created a test command which should highlight and grip the last added entity of the
acad database.
> Here is the code:
>
> ads_name SelName;
> int b = acedSSGet("L", NULL, NULL, NULL, SelName);
> long len;
> acedSSLength(SelName, &len);
> int a = acedSSSetFirst(SelName, SelName);
>
> acedSSGetFirst succeeded, but acedSSSetFirst returns always 5001 (error). Why?
> In addCommand of this command the two important flags ACRX_CMD_USEPICKSET | ACRX_CMD_REDRAW are set.

Please use real selectionsets, because acedSSSetFirst needs them.

//1: create empty selection set
ads_name ss;
acedSSAdd(NULL, NULL, ss);

//2: add one or more entities
acedSSAdd(SelName, ss, ss);

//3:
acedSSSetFirst(ss, ss);

//4: free selset
acedSSFree(ss);
>
Good luck,

Jens Arnold
Message 3 of 3
Anonymous
in reply to: Robert-

Your code worked fine for me.

 

Are you sure that the acedSSGet() call actually
returns a non-empty selection set?  If so, then what is the context that
you are executing the command?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hello,


I want to highlight and grip some entities. I created a test command
which should highlight and grip the last added entity of the acad database.

Here is the code:

ads_name SelName;
int b = acedSSGet("L",
NULL, NULL, NULL, SelName);
long len;
acedSSLength(SelName,
&len);
int a = acedSSSetFirst(SelName, SelName);

acedSSGetFirst
succeeded, but acedSSSetFirst returns always 5001 (error). Why?
In
addCommand of this command the two important flags ACRX_CMD_USEPICKSET |
ACRX_CMD_REDRAW are set.

Hope somebody could help me!

with kind
regards,
Robert

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

Post to forums  

Autodesk Design & Make Report

”Boost