Problem intersectWith using

Problem intersectWith using

Anonymous
Not applicable
859 Views
4 Replies
Message 1 of 5

Problem intersectWith using

Anonymous
Not applicable

 

	int out = 0;
	//////////////////////////////////////////////////
	AcDbEntity* pEnt1;
	AcDbEntity* pEnt2;
	AcGePoint3d pick;
	AcDbObjectId id1;
	AcDbObjectId id2;
	Acad::ErrorStatus es;
	AcGePoint3dArray is;
	//////////////////////////////////////////////////
	acdbGetObjectId(id1, tempEN1);
	acdbOpenAcDbEntity(pEnt1, id1, AcDb::kForRead);
	acdbGetObjectId(id2, tempEN2);
	acdbOpenAcDbEntity(pEnt2, id2, AcDb::kForRead);
	//////////////////////////////////////////////////
	es = pEnt1->intersectWith(pEnt2, AcDb::kOnBothOperands, is);
	//////////////////////////////////////////////////
	if (es != Acad::eOk)
	{
		acutPrintf(_T("\nIntersectWith failed : es = %s"), acadErrorStatusText(es));
	}
	else
	{
		out = is.length();
		for (int i = 0; i<is.length(); i++)
		{
			if (i == 0) acdbPointSet(asDblArray(is[0]), subPO1);
			else if (i == 1) acdbPointSet(asDblArray(is[1]), subPO2);
			else if (i == 2) acdbPointSet(asDblArray(is[2]), subPO3);
			else if (i == 3) acdbPointSet(asDblArray(is[3]), subPO4);
			else if (i == 4) acdbPointSet(asDblArray(is[4]), subPO5);
			else if (i == 5) acdbPointSet(asDblArray(is[5]), subPO6);
			else if (i == 6) acdbPointSet(asDblArray(is[6]), subPO7);
			else if (i == 7) acdbPointSet(asDblArray(is[7]), subPO8);
			else if (i == 😎 acdbPointSet(asDblArray(is[8]), subPO9);
			else if (i == 9) acdbPointSet(asDblArray(is[9]), subPO10);
		}
	}
	pEnt1->close();
	pEnt2->close();
	//////////////////////////////////////////////////
	return out;

The intersectWith() function works fine, but the number of AcGePoint3dArrays is 0..

What is the problem??

0 Likes
Accepted solutions (1)
860 Views
4 Replies
Replies (4)
Message 2 of 5

Alexander.Rivilis
Mentor
Mentor

With what kinds of entities you tested 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
Message 3 of 5

Anonymous
Not applicable

Pline !

0 Likes
Message 4 of 5

Alexander.Rivilis
Mentor
Mentor
Accepted solution

@Anonymous wrote:

Pline !


And both of them in one plane? Try other intersectWith method, which use projected plane:

изображение.png

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

Anonymous
Not applicable

It was not on the same plane. Thanks for solving the problem!

0 Likes