//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)
Solved! Go to Solution.
Solved by AdskBophy. Go to Solution.
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);
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
Did my response resolve the problem? If so, please mark the question as answered.
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?
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.
thank you very much, i had Upload the complete code in TstSelection.zip
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.
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?
You're more likely to get help if you describe the underlying goal. What is the real problem you are trying to solve?
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?
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.