Welcome to Golden Software Support

Has Shapes Collection changed?

Comments

4 comments

  • Avatar
    David

    As I look into this a bit more, a lot of things have changed in Surfer. I've been using a command "Shapes.AddBaseMap()" which appears to have been deprecated in Surfer 16. I don't know when that happened, but it looks like I'll have to change my code to some other method that is supported.

    0
    Comment actions Permalink
  • Avatar
    Leslie McWhirter

    Hi David,

    I'm not sure what you mean by "I see there are 5 Shapes collections". There is only one Shapes collection (so subsequently, there is no Shapes5, and no documentation for other Shapes collections). Where are you seeing that there are 5?

    Since you are running your script in a non-native environment, and since your script runs on your other computer, I suspect VB is having issues finding Surfer or Scripter on your computer. Even though the title is misleading, please follow the instructions here to make sure your programs can see one another: My other software (e.g. geoSCOUT) can't find Surfer. How can I fix this?

    As for your comment about AddBaseMap, that changed in Surfer 15 when raster and vector base maps were split apart. Deprecated commands are still supported, just not recommended moving forward, since they won't get any new features. So your script should still work even with AddBaseMap.

    Thanks!
    Leslie McWhirter
    Golden Software

    0
    Comment actions Permalink
  • Avatar
    David

    The 5 shapes comes from the Object browser in VB.net, which is the reference i have to use. Over the years, I've found that VS tends to enforce rules about objects rather stringently, which is both good and bad. Golden Sotware may only think that there is a single Shapes Collection, but the fact is, they have published at least 5 revisions to the Shapes collection as Object Libraries to folks like Microsoft, who just gathers them together and keeps them in a list until they are told otherwise, which, apparently, Golden Software has neglected to do. I did find that after i did a clean install of Windows 10 (Build 1909) that now all of my VB programs automating Surfer are now working again, but with one small change. I used to be able to call a method using the Public name I had created

    Public srf as New Surfer.Application

    Then I could call a property using srf. For example, "With ContourMap.SmoothContours = srf.SrfConSmoothType.srfConSmoothHigh". That no longer works, so now I have to use the same construct but substitute srf with Surfer, as in "With ContourMap.SmoothContours = Surfer.SrfConSmoothType.srfConSmoothHigh". I have no idea why Surfer is more acceptable than srf, which used to work, and I really don't know who to thank for that, Golden Software or Microsoft.

    0
    Comment actions Permalink
  • Avatar
    Leslie McWhirter

    Hi David,

    Thanks for clarifying where you were seeing those Shapes collections. The number shown there is like a version of the Shapes collection, you can still call Shapes rather than Shapes4 or Shapes5.

    As for your other issue, I can provide direct Scripter support, but I cannot provide support for VB calling Scripter/Surfer, so I'm not sure how to help unless you're seeing the same issue with a Scripter script run in Scripter.

    Thanks!
    Leslie

    0
    Comment actions Permalink

Please sign in to leave a comment.