COM Automation

From SysCAD Documentation

Jump to: navigation, search

Navigation: User Guide -> COM Automation

Introduction

A set of COM Automation commands can be used to externally control SysCAD. This replaces the Command Scripts functionality available in SysCAD with a much richer and interactive set of programing commands.

The Automation interface can be used in a number of basic or advanced situations. Most commonly, VBA which is Visual Basic for Applications (for example within Excel), is used to write a macro for starting SysCAD and then loading, running and generating reports for SysCAD projects.

The COM Automation interface is commonly used in various software packages. When SysCAD is installed a number of tlb files are installed and registered. These can be used to include the SysCAD Automation interface in your software development of VBA macro's.

The most commonly used basic commands allow you to:

  • start SysCAD
  • open projects
  • set tags
  • start the solver
  • retrieve tag values
  • generate reports
  • close projects

VBA Automation Example

To use the COM interface in VBA, in the "References" dialog for the VBAProject, select the references "SysCAD 9.2 Application Library" and "SysCAD 9.2 Solver Library". The corresponding DLL and TLB files are installed with SysCAD. In SysCAD 9.1 there are three libraries "SysCAD Application Library", "SysCAD Model Library" and "SysCAD Solver Library". If you have multiple copies of SysCAD installed, be sure that the correct version at the correct location is being used. To change this, exit SysCAD and all aplications that reference the COM object (including Excel) and run regall.cmd in the bin folder of the SysCAD version that should be used.

An Excel example is shown here. See Automation example


Python Automation Example

To use COM automation from within python, you need to install the Win32All extensions [1]. A python example is shown here. See Python Automation example

Personal tools
Document Sections