how can i get the boundary entity from a pick point?
Can any one help me!
Hi,
if your boundaries are closed polylines then this could be one approach:
Good lock, - alfred -
ads_point pt; ads_name plBndry; if( acedGetPoint(NULL, _T("Pick a point inside a closed area:"), pt) != RTNORM ) return; acedCommand(RTSTR, _T("-BOUNDARY"), RTSTR, _T("AD"), RTSTR,_T("IS"), RTSTR,_T("Y"),RTSTR,_T("OB"),RTSTR,_T("PO"),RTSTR,_T(""), RTPOINT, pt, RTSTR, _T(""), RTNONE); acdbEntLast(plBndry); // here is your boundary.
sample doesn't control boundary creation. so, you have to use acdbEntLast before this code too. and then compare two last entities (before and after boundary creation). if they are different - code created boundary.
ObjectARX SDK since version 2011 provide acedTraceBoundary function which can help you. Read carefully its description in the ObjectARX documentation.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
Hi Alexander,
>> ObjectARX SDK since version 2011 provide acedTraceBoundary function which can help you
Have you already played with that function?
IMHO it has the same problem as the default _BOUNDARY-command, sometimes it does not see objects as they are out of display-list-active area. Did you get better/other results?
- alfred -
hi, alfred.
acedCommand ( RTSTR, _T("_zoom"), RTSTR, _T("_e"),RTNONE ); // before command
acedCommand ( RTSTR, _T("_zoom"), RTSTR, _T("_p"),RTNONE); // after command
will help to fix it. it's an only way
@Alfred.NESWADBA wrote:
Hi Alexander,
>> ObjectARX SDK since version 2011 provide acedTraceBoundary function which can help you
Have you already played with that function?
IMHO it has the same problem as the default _BOUNDARY-command, sometimes it does not see objects as they are out of display-list-active area. Did you get better/other results?
- alfred -
That is why I wrote to read documentation carefully:
To succeed, the entities that form the boundary to be found must be entirely visible on screen in the AutoCAD editor.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
Hi,
thanks to both of you, however using such algorithms depending the visibility on screen + depending the size of the object on the screen + depending the zoom-factor + + + ....makes me ill when I do develop anything like GIS searching not just one boundary but thousands.
Additionally the command _BOUNDARY sometimes does not work
So SendCommand (whatever internal method is used) does not work correct in all cases, if the ARX-functionality is equal to the command, then at least be very careful using that!
For me the conclusion is: don't use that as it does not work well.
- alfred -
BTW: for Autodesk, that bug (described in b)) I reported for AutoCAD 2004 I think. With 2013 it's still there 😞
in some cases it does NOT follow the geometry exactly
Alfred, it doesn't follow at all for splines and sometimes doesn't follow for arc segments.
In my case I don't have such problems, because I know all object's type, that will be used for boundary command, and I can create a simplified variant for them (just linear segments) just for this command.
don't use that as it does not work well
There are no other variants. So, if it doesn't work well, force it :):):) To write it manually is much harder than to force raw variant to work correctly.
that bug (described in b)) I reported for AutoCAD 2004 I think. With 2013 it's still there
it's not a bug. it's an "expected behavior":). they have no time to fix it 🙂 android and kinect are autocad's future
Hi,
>> To write it manually is much harder than to force raw variant to work correctly.
But as long as you need your program working, it's a must (and it's done already 😉 but not using acedTraceBoundary as this part was written in 2007 or so)
>> it's not a bug. it's an "expected behavior"
🙂
- alfred -