b.sara

How to Open a Table, Convert it to ShapeFile & projecting the data using the X and Y

Discussion created by b.sara on May 19, 2011
Latest reply on Jun 14, 2011 by b.sara
Hi,
i need to create the same window as this one using VBA :




it's my first project using ArcObject,  i create this interface :




i did programme the button "Parcourir" ( browse ) using a commonDialog, it get just the files "*.dbf"
Private Sub CmdPrc_Click()

On Error GoTo Annuler
With CommonDialog1
    .DialogTitle = "Choisissez une Table"
    .CancelError = True
    .Filter = "Tous (*.dbf)|*.dbf"
    .InitDir = "C:\"
    .ShowOpen
  Text1.Text = .fileName
   
Annuler:
If Text1.Text = "" Then
    Label1.Caption = "Vous n'avez sélectionné aucun fichier."
    Else
    Label1.Caption = ""
    End If
End With

End Sub



the combobox also works good, but they take there value manually, this is the code :

Private Sub UserForm_Initialize()
With CmboX
    .AddItem "OID"
    .AddItem "PT"
    .AddItem "PP"
    .AddItem "PI"
    .AddItem "BPLB"
    .AddItem "BPLL"
    .AddItem "RP"
    .AddItem "CO2B"
    .AddItem "CO2L"
    .AddItem "MGOB"
    .AddItem "MGOL"
    .AddItem "X"
    .AddItem "Y"
End With
With CmboY
    .AddItem "OID"
    .AddItem "PT"
    .AddItem "PP"
    .AddItem "PI"
    .AddItem "BPLB"
    .AddItem "BPLL"
    .AddItem "RP"
    .AddItem "CO2B"
    .AddItem "CO2L"
    .AddItem "MGOB"
    .AddItem "MGOL"
    .AddItem "X"
    .AddItem "Y"
End With

CmboX.ListIndex = 11
CmboY.ListIndex = 12
End Sub




now i'm sticked at "Ok" button, and Edit button  i don't know how to fix it,

the Button "Ok" should :

- Open the Table "*.dbf" , then take the coordinate X and Y, and convert it to a shapefile , then open all the data with there (X, Y) in ArcMAP


the Button "Edit" should open that window to define a projection and a coordinate system :



that you can get it by adding a table -> click right -> Display XY Data ->  click button "Edit"



i need to programme that, that's the point of my training end of study
I need help, please if anyone could help me.

Outcomes