Welcome to Golden Software Support

How do I get the polyline vertices of a .shp

Comments

1 comment

  • Avatar
    Leslie McWhirter

    Hello Björn,

    Is your purpose for getting the vertices into an array just to print the array, like the bottom example shows? If so, I instead recommend turning off the map axes and exporting to a BLN file. This can be accomplished via automation (see example below). The BLN can then be opened in a text editor. Each shape in the file will be separated by a header row.

     

    Sub Main
    
     Dim SurferApp, MapFrame As Object
     Set SurferApp = CreateObject("Surfer.Application")
     SurferApp.Visible = True
     Dim Plot As Object
     Set Plot = SurferApp.Documents.Add(srfDocPlot)
    
     Set MapFrame = Plot.Shapes.AddBaseMap(ImportFileName:="C:\path\profiles.shp")
    
     MapFrame.Axes.Item(1).Visible=False
     MapFrame.Axes.Item(2).Visible=False
     MapFrame.Axes.Item(3).Visible=False
     MapFrame.Axes.Item(4).Visible=False
    
     Plot.Export2(FileName:="C:\path\profiles.bln", FilterID:="bln")
    
    End Sub
    

     

    Thanks!

    Leslie McWhirter

    Technical Support

    Golden Software

     

    0
    Comment actions Permalink

Please sign in to leave a comment.