AVAX-software.com Forums: Deleting layers - AVAX-software.com Forums

Jump to content

Page 1 of 1

Deleting layers

#1 User is offline   Rplp4 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 19
  • Joined: 21-May 08

Posted 04 July 2008 - 02:13 PM

How can I delete/remove a layer and all objects on the layer.

#2 User is offline   Athanasios Gardos Icon

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

Posted 07 July 2008 - 12:29 PM

Private Sub Command1_Click()
    Dim iType() As AvaxItemType
    Dim iColor() As Integer
    Dim iWidth() As Integer
    Dim iStyle() As Integer
    Dim iLayer() As Integer
    Dim Elev3D() As Single
    Dim Height3D() As Single
    Dim h() As Long, hToDel() As Long
    Dim lMax As Long
    Dim lCnt As Long
    Dim lCount As Long
    Dim LayerToDelete As Integer
    lMax = cAvax1.GetAllHandlesArr(h())
    LayerToDelete = 2
    If lMax > 0 Then
       lCount = 0
       ReDim hToDel(lMax) As Long
       If cAvax1.GetAttributes(h(), iType(), iColor(), iWidth(), iStyle(), iLayer(), Elev3D(), Height3D()) = True Then
          For lCnt = 1 To lMax
              If iLayer(lCnt) = LayerToDelete Then
                 lCount = lCount + 1
                 hToDel(lCount) = h(lCnt)
              End If
          Next lCnt
       End If
    End If
    If lCount > 0 Then
       ReDim Preserve hToDel(lCount) As Long
       Call cAvax1.DeleteItems(hToDel())
    End If
End Sub

Private Sub Form_Load()
    Command1.Caption = "remove layer 2"
    Call cAvax1.StartAvax
    cAvax1.Add_Rectangle 0, 0, 10, 10, , , , , 1 'Rectangle at Layer 1
    cAvax1.Add_Line 0, 0, 0, 10, 10, 0, , , , , 2 'Line at Layer 2
    cAvax1.Add_Line 0, 10, 0, 10, 0, 0, , , , , 2 'Line at Layer 2
End Sub

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

Athanasios Gardos
Avax-Software.com

#3 User is offline   Rplp4 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 19
  • Joined: 21-May 08

Posted 12 July 2008 - 01:48 AM

Thank you for your help

Page 1 of 1


Fast Reply

  

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