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

Remove sub entities form a existing selection

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
AdskBophy
728 Views, 11 Replies

Remove sub entities form a existing selection

//I want to remove sub entities form a existing entities use acedSSSet :$+:k mode by mouse click in the screen,
//it's effect like edit AcDbDynBlockReference repick entity (cad Command:bedit->bactionset)
//i do this:
//1,create a empey selection;
//2,add existing entities to selection;
//3,run acedSSGet(":$:K"......);
//code:
int res;
ACHAR* promptPtrs[2];
ACHAR KeyW[16]="Add Remove _A R";
promptPtrs[0]="Select Entity(Add)Or(Remove))A" ;
promptPtrs[1]="Select Entity(Remove)Or(Add))R" ;
//clear the pickfirst selection,
acedSSSetFirst(NULL,NULL);
resbuf* (*oldFunc) (const ACHAR*);
acedSSGetKwordCallbackPtr(&oldFunc);
res=acedSSSetKwordCallbackPtr(keywordCallback);
//create a empty selection
res=acedSSAdd(NULL,NULL,ssname);
//add to selection and hlight
for (.....)
{
res=acedSSAdd(entname,ssname,ssname);
acedRedraw(entname,3);
}
res=acedSSGet(":$:K",promptPtrs,KeyW,NULL,ssname);
//if i sel "R" keyword ret -5001,it looks like none entity in the selection,why?
//i had added to the selection(ssname)

11 REPLIES 11
Message 2 of 12
owenwengerd
in reply to: AdskBophy

I'm not sure I understand the question, but I think your mistake is calling acedSSGet with a non-empty selection set and expecting it to use what is in the selection set. Try this:

acedSSSetFirst(ssname,NULL);
ads_name ssnew;
res = acedSSGet(ACRX_T(":$:K"),promptPtrs,KeyW,NULL,ssnew);

 

--
Owen Wengerd
ManuSoft
Message 3 of 12
AdskBophy
in reply to: owenwengerd

repick.gif

it's like this,there are had some entities in the  AcDbObjectIdArray , i want to Add entities to it or Remove  entities  from it, if sel "a" keyword is add;if sel "r" keyword is remove

Message 4 of 12
owenwengerd
in reply to: AdskBophy

Did my response resolve the problem? If so, please mark the question as answered.

--
Owen Wengerd
ManuSoft
Message 5 of 12
AdskBophy
in reply to: owenwengerd

thks your reply,but failed.

the picture show's is the autocad owner's ,that's function is i want to implement.

in other words,there have 5 entities's id in the AcDbObjectIdArray, but just 2 entites is my need,

so i must remove 3 entities form the AcDbObjectIdArray, which one will be removeing?

this time i use acedSSGet to do it. or my idea is wrong?

Message 6 of 12
owenwengerd
in reply to: AdskBophy

Sorry, I don't understand. It might be helpful if you post your corrected code and explain exactly how and where it fails. Describe what you expect to happen, and what actually happens, including any error status.

--
Owen Wengerd
ManuSoft
Message 7 of 12
AdskBophy
in reply to: owenwengerd

thank you very much, i had Upload the complete code in TstSelection.zip

Message 8 of 12
owenwengerd
in reply to: AdskBophy

It looks like you are trying to incorporate user interaction into a double click reactor callback. I don't think this is possible. It certainly doesn't seem logical to introduce new user interactions while a double-click user interaction event is being handled. You need to manage the selection set content *before* the user double-clicks on a selected object.

--
Owen Wengerd
ManuSoft
Message 9 of 12
AdskBophy
in reply to: owenwengerd

how can i manage the selection set content,and get the content?

Whether the entity is added to the container can be success?

how about class AcEdSSGetFilter and AcEdSelectionSetService?

They can achieve the functions I need?

Message 10 of 12
owenwengerd
in reply to: AdskBophy

You're more likely to get help if you describe the underlying goal. What is the real problem you are trying to solve?

--
Owen Wengerd
ManuSoft
Message 11 of 12
AdskBophy
in reply to: owenwengerd

first thank you very much.

do you have my code of the last time? This time I put some line changed to red, and without the "K" keyword.
Let's say The circle is associated with 8 lines of idarr, now I double-click on the circle wanted to delete 5 red lines from idarr,

and add 3 white lines to the idarr,you say how I should do? Do not know that whether or not to understand?

 

Message 12 of 12
owenwengerd
in reply to: AdskBophy

I have not tried to build and run your code; I only scanned through it in a text editor. Sorry, I am out of ideas.

--
Owen Wengerd
ManuSoft

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

Post to forums  

Autodesk Design & Make Report

”Boost