Custom Entity Jig

Custom Entity Jig

daniel_gearloose
Enthusiast Enthusiast
438 Views
2 Replies
Message 1 of 3

Custom Entity Jig

daniel_gearloose
Enthusiast
Enthusiast

Why do i get these Errors?

 

Unbenannt.JPG

 

Jig.h file

#pragma once


class CCircleJig : public AcEdJig
{
public:
CCircleJig();
virtual ~CCircleJig();
virtual Adesk::Boolean update() override;
virtual DragStatus sampler() override;
virtual AcDbEntity* entity() const override { return m_pCircle; }

AcEdJig::DragStatus start();

protected:

enum stage
{
radius,
center
};

stage m_Stage;
AcGePoint3d m_PntPrev;
cxDbEmbeddedEntity* m_pCircle;
//double m_Radius;
};

void CreateCircle();

 

Jig.cpp file

 

#include "StdAfx.h"
#include "PointJig.h"
#include "..\EmbeddedEntity\xDbEmbeddedEntity.h"


CCircleJig::CCircleJig() : m_Stage(center)
{
	m_pCircle = new AcDbPoint(AcGePoint3d::kOrigin);

}

CCircleJig::~CCircleJig()
{
};

Adesk::Boolean CCircleJig::update()
{
	if (m_pCircle == NULL)
		return false;

	switch (m_Stage)
	{
	case center:
		//m_pCircle->setRadius(m_Radius);
		m_pCircle->setCenter(m_PntPrev);
		break;

	default:
		return false;
	}

	return true;
}

AcEdJig::DragStatus CCircleJig::sampler()
{
	setUserInputControls((UserInputControls)(AcEdJig::kAccept3dCoordinates | AcEdJig::kNullResponseAccepted));

	DragStatus sts;
	AcGePoint3d pntTemp;
	if (m_Stage == center)
		sts = acquirePoint(pntTemp, m_pCircle->position());
	else
		sts = acquirePoint(pntTemp);
	if (sts == AcEdJig::kNormal)
	{
		if (pntTemp.isEqualTo(m_PntPrev))
			sts = kNoChange;
		m_PntPrev = pntTemp;
	}
	return sts;
}

AcEdJig::DragStatus  CCircleJig::start()
{
	CString sPrompt;
	m_Stage = center;

	//acedGetReal(L"\nDurchmesser: ", &m_Radius);
	//m_Radius = m_Radius / 2;
	sPrompt = _T("\nMittelpunkt: ");
	setDispPrompt(sPrompt);
	AcEdJig::DragStatus sts = drag();
	if (sts != kNormal)
		return sts;

	if (sts == kNormal)
	{
		AcDbObjectId idCircle = append();
	}

	return sts;
}

void CreateCircle()
{
	CCircleJig circleJig;
	circleJig.start();
}
0 Likes
439 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor

Try to change:

#include "PointJig.h"
#include "..\EmbeddedEntity\xDbEmbeddedEntity.h"

with:

#include "..\EmbeddedEntity\xDbEmbeddedEntity.h"
#include "PointJig.h"

If class cxDbEmbeddedEntity is defined in xDbEmbeddedEntity.h, code have to be compiled successfully.

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

Message 3 of 3

daniel_gearloose
Enthusiast
Enthusiast

ok,  i try it.. found some other mistakes and now I am steps further...

Thaaanks 🙂

0 Likes