Can acedssget do this jop?
I want to select all the visible or invisible entities, the code below shows my way, but it can only select all entities.
ads_name ssName;
static int nSel = 0;
if (!Acad_System::GetInputInt(_T("0-可见 1-不可见"),nSel))
{
return;
}
resbuf* rb = ads_buildlist(RTDXF0,_T("line"),60,(nSel),RTNONE);// 0 select all, 1 nothing. why?
int es = acedSSGet(_T("A"),NULL,NULL,rb,ssName);
ads_relrb(rb);
long lNumber = 0;
ads_sslength(ssName,&lNumber);
acutPrintf(_T("\n%d"),lNumber);
ads_ssfree(ssName);
Solved! Go to Solution.
Solved by Alexander.Rivilis. Go to Solution.
@cnngtdly wrote:
I want to select entites whose layer is on. but with (60,0), i get all the entities.
You're absolutely wrong. Flag of visibility does not depend on or off the layer to which the entity belongs. It's completely different things. Visibility flag (dxf-Group 60) is determined with AcDbEntity::setVisibility() method.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
I understand your meaning. but is there any way to get what i want with acedssget?
Or is there a quick method to get entities whose layers are on or off?
My way is like this:
I get all entities, then iterator the result,
get the layer of each entity, check the layer's state,....
I believe this is not effecient.
@cnngtdly wrote:
My way is like this:I get all entities, then iterator the result,
get the layer of each entity, check the layer's state,....
I believe this is not effecient.
This method can be very effective if you first make AcDbObjectIdArray for all layers which turn on and not frozen.
And then check that the layer of each primitive from selectionset contained in this AcDbObjectIdArray.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
thanks for your advice. it seems that there is no arx api to do this job.
If i have to write code by myself , i will use std::set or map to increase speed.
@cnngtdly wrote:
...it seems that there is no arx api to do this job...
There is another method, but I would not recommend it. You can list all turned on and thawed layers and add it to the filter in the form:
resbuf* rb = ads_buildlist( RTDXF0,_T("line"), -4, _T("<OR"), 8,_T("layerOn1"), 8,_T("layerOn2"), ... -4, _T("OR>"), RTNONE );
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn