How to compare points in a custom line entity

How to compare points in a custom line entity

Anonymous
Not applicable
513 Views
3 Replies
Message 1 of 4

How to compare points in a custom line entity

Anonymous
Not applicable

I have a custom line entity called Myline. I know that this entity have two methods : Myline.startpoint() and myline.endpoint().

I need to compare these points and check if these points are connected together or not. For this reason, I collect all points in a vector and then compare each one to another.

Could you help me how can I do that? Can I compares points in a normal way like below:

if (point1==point2) {
}

Or I need to use isequalto function as below:

if (point1.isequalto(point2, AcGeContext::gTol)==Adesk::KTrue {
}

But all above ways return errors in my code.

 

 

0 Likes
514 Views
3 Replies
Replies (3)
Message 2 of 4

Alexander.Rivilis
Mentor
Mentor

Read inc\gepnt3d.h:

inline bool AcGePoint3d::operator == (const AcGePoint3d& p) const
{
    return this->isEqualTo(p);
}

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
Expert Elite Member

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thank you Alexander!

Then I can use == operator.

But why my code returns Exception error?

 

0 Likes
Message 4 of 4

Alexander.Rivilis
Mentor
Mentor

@Anonymous  написал (-а):

Thank you Alexander!

Then I can use == operator.

But why my code returns Exception error?

 


I think need to look at this code.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
Expert Elite Member

0 Likes