Search the Knowledgebase |
Browse by Category |
|
|
|
| What's the best way to learn Scripter? |
| User Opinions |
12%
87%
|
|
Thank you for rating this answer.
|
I found that the easiest way to learn how to write scripts is to know what you want to do in the program. Anything you can do in the program, you can do in a script, the sequence will be the same. Once you know the sequence of steps you want to perform, the next step is writing the script. For many people, scripting is not something you read about and learn and then perform, the easiest way to learn it is through practice and to delve right in. The best ways to start writing the script are to 1) use the Help menu, and 2) look at example scripts:
1. Using the Help menu If you go to Help | Surfer Automation Help, the help file will open. On the Contents tab, open the Surfer Automation book. Under this book are two additional books that I frequently use: Objects and List of Methods and Properties.
If I want to change something about an object, like changing something about a contour map, open up the Objects book and click on that object (ie. ContourMap Object). This shows you everything you can do to that object. If I wanted to do or change anything that is listed there under the Properties or Methods section, I would just click on the link for the correct syntax and an example to see how to do it. If something I want to do is not listed, like rotating the map, then I need to look above or below the Properties and Methods section. Above the Properties, I see that it says the ContourMap object is derived from the Shape object. This means that all the Properties and Methods that are listed under the Shape Object also apply to the ContourMap Object. If I click on the Shape Object link, you see that Rotation is one of the Properties. So you can use this with the ContourMap Object.
However if I want to perform an action, like going to Grid | Data in the program, I would open up List of Methods and Properties and look for something along the lines of "Grid Data" (ie. GridData). When I find it, I click on it, and the help topic appears on the right. All the options for GridData are here and it gives an example script.
2. Example scripts Example scripts are also very useful. A number of sample scripts are zipped and attached to this article. You can also find more samples on the Surfer scripts download page.
See also: What is the easiest way to learn Scripter? This was written for MapViewer, but the concepts apply to Surfer as well.
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|