Please enable JavaScript to view this site.

MESYS Calculation Software

Navigation: General > COM Interface

Using the COM server

Scroll Prev Top Next More

The COM server can be used to call functions within the MESYS software from other programs.

A simple example in a VisualBasic function:

Public Sub test()

Dim mesys As MesysCOM

Set mesys = New MesysCOM

Dim rbc As MesysRBC

 

Set rbc = mesys.createRBC

Dim d As Long

Dim pmax As Double

 

Call rbc.setVarInt("inputType", 2)

Call rbc.setVarInt("Z", 12)

Call rbc.setVarDouble("Dw", 5)

Call rbc.setVarDouble("Dpw", 50)

Call rbc.setVarDouble("Fy", 1000)

Call rbc.setVarDouble("ni", 500)

 

result = rbc.Calculate

Call rbc.showReport("c:/temp/report.pdf")

Call rbc.getVarDouble("pmax", pmax)

Call rbc.getVarInt("Z", d)

Call rbc.calculateBearing(True, 0, True, 1000, True, 0, False, 0, False, 0, 500, 0, 20, 20)

Call rbc.getVarDouble("pmax", pmax)

Set rbc = Nothing

Set mesys = Nothing

 

End Sub

 

And here the same example in Python using the members with variants as [in, out] parameters do not work from python:

import comtypes.client

 

mesys = comtypes.client.CreateObject("MesysCOM64.MesysCOM")

rbc = mesys.createRBC()

rbc.setVar("inputType", 2)

rbc.setVar("Z", 12)

rbc.setVar("Dw", 5)

rbc.setVar("Dpw", 50)

rbc.setVar("Fy", 1000)

rbc.setVar("ni", 500)

rbc.calculate()

rbc.showReport("c:/temp/report.pdf")

pmax = rbc.getVar("pmax")

z = rbc.getVar("Z")

rbc.calculateBearing(True, 0, True, 1000, True, 0, False, 0, False, 0, 500, 0, 20, 20)

pmax2 = rbc.getVar("pmax")

stiffness = rbc.getStiffnessMatrixAsVector();

rbc = None

mesys = None