Translating a drawing

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

Moderators: SDS, support, admin

Post Reply
aby
Posts: 81
Joined: 21 May 2007, 13:02
Location: Turkey

Translating a drawing

Post by aby » 08 Oct 2009, 11:26

Hi,

How can I translate a whole drawing to new coordinates.

I want to move every entity form one point to another.

Thanks

Aby

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

Re: Translating a drawing

Post by support » 16 Oct 2009, 13:10

Hello.
To translate the whole drawing to new coordinates you need:
1. Change coordinates of every entity.
2. Call TsgCADImage.GetExtents to recalculate new coordinates.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

aby
Posts: 81
Joined: 21 May 2007, 13:02
Location: Turkey

Re: Translating a drawing

Post by aby » 19 Oct 2009, 10:47

Hello.
To translate the whole drawing to new coordinates you need:

" 1. Change coordinates of every entity."

I was asking how am I going to change the coordinates of every entity.

The long way is to write a virtual method for every type of entity to translate to new coordinates,
and the price for thisparadigm is very high in terms of time.

The short way is,

I'm observing you are rotating the drawings as you wish.
Certainly you wouldn't supply a method for each entity to rotate, rather you should do it with matrix multiplication.

How can I do the same. I don't want not to rotate but to translate.

Thanks

Aby

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

Re: Translating a drawing

Post by support » 19 Oct 2009, 11:31

Hello aby.
Your question was about translating whole drawing to the new coordinates. Or you want to move picture on screen? When translating picture to new coordinates, you won't see any differences on screen after such manipulation. But rotation is only change of visible reflection - entities' coordinates won't change. If you want to change picture location onscreen, it is possible to use such method like rotation does.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply