{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# AnyBody magic in IPython Notebooks\n", "******\n", "\n", "The _anybodymagic_ extension for IPython will run AnyBody macro commands directly from the IPython Notebook. This is a very easy way to work with the AnyBody console application.\n", "\n", "### Requirements\n", "The [AnyBody Modeling System](www.anybodytech.com) must be installed on the computer for this extension to work. \n", "\n", "###Installation and requirements\n", "The extension is installed directly from github with the `%install_ext` command." ] }, { "cell_type": "code", "collapsed": false, "input": [ "%install_ext https://raw.github.com/melund/anybodymagic/master/anybodymagic.py" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Installed anybodymagic.py. To use it, type:\n", " %load_ext anybodymagic\n" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Usage\n", "When the extension is installed, it can be loaded with the `%load_ext` command." ] }, { "cell_type": "code", "collapsed": false, "input": [ "%load_ext anybodymagic" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 24 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Anybody macro commands are executed with the `%%anybody` cell magic. The remaining cell is passed directly to AnyBody as macro commands\n", "\n", "Here is an example " ] }, { "cell_type": "code", "collapsed": false, "input": [ "%%anybody\n", "load \"Knee.any\"\n", "operation Main.MyStudy.InverseDynamics\n", "run\n", "exit" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "