Length and image rotate
Posted: 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
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