AVAX-software.com Forums: point coordinates - AVAX-software.com Forums

Jump to content

Page 1 of 1

point coordinates how to modify /manipulate points (x y z)

#1 Guest_Andreas_*

  • Group: Guests

Post icon  Posted 30 September 2005 - 12:26 AM

i have just downloaded the demo and very interested in buying such tool. Could you explain, how I can modify point coordinates of polylines, circles and so on from even an imported dxf file or even a fresh program created vector graphic ? Is there also a way to print for example into a plt-file instead of the plotter printer driver ?
I really like to buy this powerful control if my problems can be solved with it. Please give me some start up support !

thank you in advance
Andreas :blink:

#2 User is offline   Athanasios Gardos Icon

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

Posted 03 October 2005 - 01:11 PM

Hi,

To modify the coordinates of polylines, lines and points you can use the following code:

Private Sub Command1_Click()
    Dim lMax As Long, lCnt As Long, Handles() As Long
    Dim iType() As AvaxItemType, vProp() As Variant, vData() As Variant
    Dim x1 As Single, y1 As Single, z1 As Single
    Dim x2 As Single, y2 As Single, z2 As Single
    Dim i As Long, Distance As Single, xyz() As Single
    Distance = 1
    lMax = cAvax1.GetAllHandlesArr(Handles())
    If lMax <> 0 Then
       If cAvax1.GetProperties(Handles(), iType(), vProp(), vData()) = True Then
          For lCnt = 1 To lMax
              If iType(lCnt) = Polyline_i Then
                 xyz() = vData(lCnt)
                 For i = 1 To UBound(xyz) / 6
                     x1 = xyz((i - 1) * 6 + 1)
                     y1 = xyz((i - 1) * 6 + 2)
                     z1 = xyz((i - 1) * 6 + 3)
                     x2 = xyz((i - 1) * 6 + 4)
                     y2 = xyz((i - 1) * 6 + 5)
                     z2 = xyz((i - 1) * 6 + 6)
                     xyz((i - 1) * 6 + 1) = x1 + Distance
                     xyz((i - 1) * 6 + 2) = y1 + Distance
                     xyz((i - 1) * 6 + 4) = x2 + Distance
                     xyz((i - 1) * 6 + 5) = y2 + Distance
                 Next i
                 vData(lCnt) = xyz()
              ElseIf iType(lCnt) = Line_i Then
                 xyz() = vData(lCnt)
                 x1 = xyz(1)
                 y1 = xyz(2)
                 z1 = xyz(3)
                 x2 = xyz(4)
                 y2 = xyz(5)
                 z2 = xyz(6)
                 xyz(1) = x1 + Distance
                 xyz(2) = y1 + Distance
                 xyz(4) = x2 + Distance
                 xyz(5) = y2 + Distance
                 vData(lCnt) = xyz()
              ElseIf iType(lCnt) = Point_i Then
                 xyz() = vData(lCnt)
                 x1 = xyz(1)
                 y1 = xyz(2)
                 z1 = xyz(3)
                 xyz(1) = x1 + Distance
                 xyz(2) = y1 + Distance
                 vData(lCnt) = xyz()
              End If
          Next lCnt
          Call cAvax1.SetProperties(Handles(), iType(), vProp(), vData())
       End If
    End If
End Sub

Private Sub Form_Load()
    Dim x0 As Single, y0 As Single
    Dim nWidth As Single, nHeigth As Single
    Dim x1 As Single, y1 As Single, z1 As Single
    Dim x2 As Single, y2 As Single, z2 As Single
    Command1.Caption = "Move objects"
    Call cAvax1.StartAvax
    x0 = 0
    y0 = 0
    nWidth = 10
    nHeigth = 10
    Call cAvax1.Add_Rectangle(x0, y0, nWidth, nHeigth)
    x1 = 5
    y1 = 5
    z1 = 0
    Call cAvax1.Add_Point(x1, y1, z1, , , , 1)
    x1 = 3
    y1 = 3
    z1 = 0
    x2 = 3
    y2 = 12
    z2 = 0
    Call cAvax1.Add_Line(x1, y1, z1, x2, y2, z2)
End Sub

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


You can export the drawing into a PLT file using the function
cAvax1.PrintToPLT
Athanasios Gardos
Avax-Software.com

#3 User is offline   MUZAK Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 27
  • Joined: 04-December 07

Posted 17 December 2007 - 11:35 PM

Does This Work for Shapes?

#4 User is offline   Athanasios Gardos Icon

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

Posted 18 December 2007 - 07:48 PM

Yes it does.
Please, have a look at:
C:\Program Files\Avax Vector ActiveX R1\Examples\GetProperties\GetProperties.vbp
VB6 example
Athanasios Gardos
Avax-Software.com

#5 User is offline   MUZAK Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 27
  • Joined: 04-December 07

Posted 19 December 2007 - 06:16 AM

I used your post here changing the type to polyline_s and divided the array by 3..... I will look at example. Thanks! :rolleyes: :rolleyes:

This post has been edited by MUZAK: 19 December 2007 - 06:18 AM


Page 1 of 1


Fast Reply

  

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