Lisp and Jig - strange points from jig

Lisp and Jig - strange points from jig

Anonymous
Not applicable
508 Views
3 Replies
Message 1 of 4

Lisp and Jig - strange points from jig

Anonymous
Not applicable

Hi, my problem is a little complicated, I think.

 

I have my custom very simple jig:

 

Constructor:

PreviewJig::PreviewJig(ArcadiaPreview * entity, bool governedByOrthoMode, AcGePoint3d * pReferencePoint)
{
	m_pEntity = entity;
	
	m_flags = (UserInputControls)(AcEdJig::kAcceptOtherInputString | AcEdJig::kDisableDirectDistanceInput);
	if(governedByOrthoMode)
		m_flags = (UserInputControls)(m_flags | AcEdJig::kGovernedByOrthoMode);
	
	m_pInstance = this;
	if (pReferencePoint)
		m_pReferencePoint.reset(new AcGePoint3d(*pReferencePoint));
}

And sampler:

AcEdJig::DragStatus PreviewJig::sampler()
{	
	if(m_keywords.length())
		setKeywordList(m_keywords.kACharPtr());

	
	setUserInputControls(m_flags);

	AcEdJig::DragStatus result = AcEdJig::kNormal;
	
	if(m_pReferencePoint.get())
		result = acquirePoint(m_currentPoint, *m_pReferencePoint.get());
	else
		result = acquirePoint(m_currentPoint);
	
	return result;
}

Everything works fine, until I load LISP script. LISP calls a command that asks for several points. And the problem is that my jig returns invalid points, for example:

 

0, 0, 0

0, 0, 0

5, 5, 5

5, 5, 5

 

instead of:

0, 0, 0

5, 5, 5

 

Does anyone have any idea?

 

Of course all the points are inserted in this lisp. User does not give any points.

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

Alexander.Rivilis
Mentor
Mentor

It will be correct compare point returned with acquirePoint method and previous returned point. And if these points are equal (maybe with fuzz value) then return AcEdJig::kNoChange

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

But what about situation when there are really two same points one by one?

0 Likes
Message 4 of 4

Alexander.Rivilis
Mentor
Mentor

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

But what about situation when there are really two same points one by one?


This means that the mouse has not moved from its place and, accordingly, the primitive should not be updated. If you need to set a sequence of points, then this should be done wrong. It is necessary in the cycle to request each point. As an example you can use samples\entity\polysamp\polyjig.cpp from ObjectARX SDK.

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