50. Using Object Interface
The Object Interface provides a powerful scripting interface that can be used to open, update and analyze models via programming code. The Object Interface does not support all functions available within the software user interface, but it provides a large set of objects and functions
You can open, update and analyze models via program code written in virtually any language, including:
-
Java
-
Visual Basic in an Excel macro
-
Visual Basic in other environments
-
C++
-
etc.
TreeAge Pro is written in Java, so the Java programming language provides the most transparent look at the Object Interface via the Java package com.treeage.treeagepro.oi. This package includes the model element and analysis objects, which makes coding in Java easier because the Java IDE can "see" the TreeAge Pro objects and provides guidance on programming syntax.
However, many TreeAge Pro customers use the Object Interface through other programs, frequently via Visual Basic in an Excel macro. Languages other than Java connect to the Object Interface through the ActiveX Java package com.treeage.treeagepro.oi.activex. The ActiveX Java package allows you to instantiate the TreeAgeProApplication object. The TreeAgeProApplication object then provides access to instantiate other objects (trees, nodes, etc. from com.treeage.treeagepro.oi).
The API documentation describes the syntax for both Java packages.
We recommend that you examine the example code provided with the software in the Examples View. There are both Java and VB examples, each of which performs common tasks such as opening a model, modifying its values and running analyses.