The best way to learn how to start automating with high level APIs is by looking at samples
ScriptGen is a tool on the IxNetwork GUI that generates a complete script of your entire configuration in TCL, Python or Perl.
Although you could run the scriptgen script that got generated, but it is not meant to be used for production testing.
With all the additional configuration codes, it will run very slow.
To get the API that you need using ScriptGen, limit your configuration to a minimum so the file is fast to generate and you don't have much to parse.
On the IxNetwork GUI toolbar, select Automation and then click the ScriptGen button.
Make your selections and then at bottom, select ixNet Serialization