Contact Us
Contact our corporate or local offices directly.
Parent page: Altium NEXUS API Reference
The Schematic Application Programming Interface (API) reference details the object interfaces for Schematic objects such as schematic documents and schematic design objects.
The Schematic API consists of the Schematic Object model and Schematic API functions. The Schematic API is made accessible by the Schematic Editor in Altium NEXUS. The Schematic design object interfaces and methods are available in all script languages supported by Altium NEXUS.
An interface is basically a list of methods that a class declares it implements — that is, each method in the interface is implemented in the corresponding class. While interfaces are declared like classes, they cannot be directly instantiated and do not have their own method definitions. The Schematic design objects are wrapped by their corresponding Schematic interfaces, which makes it possible to manipulate those objects by scripts and server code.
ISch_ServerInterface
interface is the main interface in the Schematic API and represents the main Schematic Editor object. The ISch_ServerInterface
interface is the gateway to fetching other Schematic objects.ISch_GraphicalObject
interface is a generic interface used for all Schematic design object interfaces (inherited from the ISch_BasicContainer
interface).ISch_Document
, ISch_Sheet
and ISch_Lib
interfaces represent an existing Schematic or library documents.To obtain the Schematic interface that represents the Schematic editor object, invoke the SchServer
function in a script to return the ISch_ServerInterface
interface. This object interface obtains the Schematic editor server object so you can then extract data from existing Schematic objects and invoke the Schematic object's methods.
For example, the SchServer
function is highlighted in the code snippet below:
Var
Sheet : ISch_Sheet;
Begin
Sheet := SchServer.GetCurrentSchDocument
If Sheet = Nil then Exit;
// do something here
End;
Schematic script examples that demonstrate the use of Schematic interfaces can be found in the \Examples\Scripts\DelphiScript\SCH
folder.
The Schematic Object Model compromises of Schematic Object Interfaces and standalone utility functions that allow you to deal with Schematic objects from a Schematic document that's open in Altium NEXUS. An object interface is just a means of access to an object in memory.
To have access to the Schematic Editor server and manipulate common schematic design objects, you need to invoke the SchServer
function. This extracts the ISch_ServerInterface
interface, which represents the loaded schematic server in Altium NEXUS. The ISch_ServerInterface
interface is the main server object interface and contains sub object interfaces within, as shown in the diagram below.
The ISch_ServerInterface
and ISch_Document
object interfaces, amongst others, are the main object interfaces used when working with a opened schematic document in Altium NEXUS. See the Schematic API System Interfaces reference for more information.
The following diagrams represent examples of the hierarchy map for schematic design objects. In all cases, the ISch_BasicContainer
interface (which represents a schematic object's parent or child objects) is the ancestor object interface. For more information see the Schematic API System Interfaces reference.
All the descendant interfaces inherit methods and properties from their immediate parent interfaces. For example the ISch_Pie
interface has its own methods and properties as well as inherited methods and properties from the ISch_Arc
, ISch_GraphicalObject,
and finally the ancestor ISch_BasicContainer
interfaces. In the diagram below, the descended ISch_Pie
interface is shown at the right.
The below hierarchy example diagram shows the inherited sequence from the ISch_BasicConatiner
ancestor interface down to the ISch_Designator
and IOpenBus_Component
interfaces.
A further, more complex, interface hierarchy diagram (below) showing the descendants of the ISch_Label and ISch_ParametizedGroup interfaces. Methods and properties are inherited down the hierarchical chain from the ISch_BasicContainer interface to the ISch_GraphicalObject interface, and so on.
Contact our corporate or local offices directly.