Questions about solid circle

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
nicolasjul
Posts: 10
Joined: 21 Apr 2011, 17:36
Location: FRANCE

Questions about solid circle

Post by nicolasjul » 14 Oct 2011, 00:04

Hi,

First question :
I draw my solid circle like that :

Code: Select all

TsgCADCurvePolygon *vSolidCircle = new TsgCADCurvePolygon;
Tsg2DBoundaryList *v2DBList = new Tsg2DBoundaryList;
((TsgCADHatch *)vSolidCircle)->BoundaryData->Add(v2DBList);
Tsg2DArc *v2DArc = new Tsg2DArc;
v2DBList->Add(v2DArc);
v2DArc->CenterPoint = MakeF2DPoint(CentreCercle.X, CentreCercle.Y);
v2DArc->Radius = 300;
v2DArc->CounterClockWise = true;
v2DArc->StartParam = 0.0;
v2DArc->EndParam = 360.0;

TsgDXFEntity *FEnt = vSolidCircle;

if (FEnt != NULL)
{
   FEnt->Layer = img->Converter->LayerByName(D900_LAYER);
   AddEntity(img->Converter, FEnt);
   img->GetExtents();
}

Is it the best method ?

Second question : is it possible to change solid circle radius and position (not move with mouse) on runtime ?

TIA,
Engi

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Questions about solid circle

Post by support » 14 Oct 2011, 17:35

Hello Engi.
The method that you have used is correct. The radius and position can be changed on runtime:

Code: Select all

		((Tsg2DArc *)(((Tsg2DBoundaryList *)(vSolidCircle->BoundaryData->Items[0]))->Items[0]))->Radius = 100;
		((Tsg2DArc *)(((Tsg2DBoundaryList *)(vSolidCircle->BoundaryData->Items[0]))->Items[0]))->CenterPoint = MakeF2DPoint(CentreCercle.X + 50, CentreCercle.Y + 50);
		img->Converter->Loads(vSolidCircle);
		img->GetExtents();
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

nicolasjul
Posts: 10
Joined: 21 Apr 2011, 17:36
Location: FRANCE

Re: Questions about solid circle

Post by nicolasjul » 14 Oct 2011, 18:34

Hi Alexander,

Fast answer and it works great.
Thank you very much !!!

Post Reply