Rename Example

Land Auto

Rename Example

Examples:

l Parcels

l Surfaces


Sub Example_Rename_Parcels()
    
    ' This example starts by creating a Parcel named "NewParcel".
    ' The new Parcel name displayed. Finally, the new Parcel is renamed
    ' to "OldName" and is displayed again.
    Dim parcels As AeccParcels
    Dim parcel As AeccParcel
    Set parcels = AeccApplication.ActiveProject.Parcels
    
    ' ' Add a new Parcel name "NewParcel"
    Set parcel = parcels.Add("NewParcel")
    
    MsgBox "The Parcel name is: " & parcel.Name, vbInformation, "Rename Example"
    
    ' ' Rename the new Parcel to "OldParcel"
    parcels.Rename "NewParcel", "OldParcel"
    
    MsgBox "The Parcel name is: " & parcel.Name, vbInformation, "Rename Example"
    
End Sub

Sub Example_Rename_Surfaces()
    
    ' This example renames a the first Surface in the collection to "FinalSurface".
    Dim surfs As AeccSurfaces
    Dim surf As AeccSurface
    Set surfs = AeccApplication.ActiveProject.Surfaces
    
    ' Get the name of the first surface in the collection
    Set surf = surfs.Item(0)
    Dim surfName As String
    surfName = surf.Name
    
    ' Rename the surface
    surfs.Rename surfName, "FinalSurface"
    
    MsgBox "The Surface name FinalSurface was named: " & surfName, vbInformation, "Rename Example"
    
End Sub