Length and image rotate

Discuss and ask questions about CADViewX (Lite and Pro versions).

Moderators: SDS, support, admin

Post Reply
Zdravko
Posts: 6
Joined: 23 Apr 2010, 14:01

Length and image rotate

Post by Zdravko » 23 Apr 2010, 14:13

Hi
You have wroted this example:

var
x, x1, y, y1, length: double;

begin
x := (CADViewX1.CADImage.Converter.Sections[2].Entities[0] as ICADLine).Point.X;
x1 := (CADViewX1.CADImage.Converter.Sections[2].Entities[0] as ICADLine).Point1.X;
y := (CADViewX1.CADImage.Converter.Sections[2].Entities[0] as ICADLine).Point.Y;
y1 := (CADViewX1.CADImage.Converter.Sections[2].Entities[0] as ICADLine).Point1.Y; ...


Looks like you are missing (in this example) how to get length of line?

Also, I have done some things, and now I have problem when loading DWG which is rotated. When I draw line or text from code, like this example:

CADViewX1.Actions.Item("New").Execute()
set Img = CADViewX1.CADImage
set Conv = Img.Converter
set Entities = Conv.Sections(2)
set Txt = CreateObject("CADViewLib.Text")
Txt.Height = 10
Txt.Text = "Simple line text"
set Point = CreateObject("CADViewLib.Point3D")
Point.X = variable1
Point.Y = variable2
Point.Z = variable3
Txt.Point = Point
Txt.Color = RGB(255, 0, 255)
Entities.AddEntity(Txt)
Conv.Loads(Txt)
Img.RecalcExtents
Img.RefreshCurrentLayout
CADViewX1.Actions.Item("Fit to Window").Execute()

I become drawn object somewhere else, but not there where are variable1,2 and 3 values.
Variable1,2 and 3 I become with CADCoords, on MouseMove event.

Have try with RotDefault and RotToView, and image rotate OK, but line is drawn on some else place as I have become with CADCoords

Thx
ZDravko

Zdravko
Posts: 6
Joined: 23 Apr 2010, 14:01

Re: Length and image rotate

Post by Zdravko » 26 Apr 2010, 02:49

Anyone please?

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

Re: Length and image rotate

Post by support » 27 Apr 2010, 12:50

Hello Zdravko.
Rotated drawing shown generally in 3D view but the display 2D point in CADViewX is a projection of point from XY plane of drawing to the screen. Please check directions of the axes in your DWG. Entity added by mouse will appear at corresponding point on drawing XY plane.

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

Zdravko
Posts: 6
Joined: 23 Apr 2010, 14:01

Re: Length and image rotate

Post by Zdravko » 27 Apr 2010, 17:12

> Please check directions of the axes in your DWG
How to do that, please ?

> Entity added by mouse will appear at corresponding point on drawing XY plane
I'm adding entity by code, not by mouse.
Have send you VBS example and DWG file

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

Re: Length and image rotate

Post by support » 27 Apr 2010, 18:00

Hello Zdravko.
The directions of axes on drawing can be learned if select any line entity and look at its points' coordinates. However UCS defined in the DWG you sent. Coordinates in WCS required to add entity.

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

Post Reply