AVAX-software.com Forums: Set coordinates of a line by code - AVAX-software.com Forums

Jump to content

Page 1 of 1

Set coordinates of a line by code

#1 User is offline   giongcaysua Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 11-December 07

Posted 11 December 2007 - 05:39 PM

How can I set coordinates of a line to new ones by code without deleting/adding new line?

Thanks for any support!

Giongcaysua

#2 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 11 December 2007 - 06:00 PM

Here it is a VB6 example:
Option Explicit

Dim LineHandle As Long
Dim dx As Single
Dim dy As Single

Private Sub Command1_Click()
	Dim h() As Long, iType() As AvaxItemType
	Dim vProp() As Variant, vData() As Variant
	Dim xyz() As Single
	ReDim h(1) As Long
	h(1) = LineHandle
	If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then
	   If iType(1) = Line_i Then
		  xyz() = vData(1)
		  xyz(1) = xyz(1) + dx 'x1
		  xyz(2) = xyz(2) + dy 'y1
		  xyz(4) = xyz(4) + dx 'x2
		  xyz(5) = xyz(5) + dy 'y2
		  vData(1) = xyz()
		  Call cAvax1.SetProperties(h(), iType(), vProp(), vData())
		  LineHandle = cAvax1.LastHandle
	   End If
	End If
End Sub

Private Sub Form_Load()
	Command1.Caption = "Move the line"
	dx = 1
	dy = 1
	Call cAvax1.StartAvax
	LineHandle = cAvax1.Add_Line(0, 0, 0, 10, 10, 0)
End Sub

Private Sub Form_Unload(Cancel As Integer)
	Call cAvax1.EndAvax
End Sub

Athanasios Gardos
Avax-Software.com

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users