I looked at the documentation for CallMapBasicSubroutine in the Extensibility Reference:
void CallMapBasicSubroutine(
string methodName,
params string[] parameters
)
The parameters need to be passed to the subroutine as a string array.
The docs state:
Parameters
methodName
Type: SystemString
name of the mapbasic subroutine to call
parameters
Type: SystemString
Parameters to the subroutine. Parameters are passed by value to the subroutine; if the subroutine accepts no arguments, then pass null.
However, after reading this post, I realized that we may not support you passing multiple parameters as an array. The workaround is to concatenate your parameters into a single string separated by semicolons, and then split them in the procedure.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 09-19-2025 15:00
From: Ferhad Pakzat
Subject: How to pass a parameter from Python to a MapBasic procedure?
Hi,
If I can, how do I pass a parameter to the "FromPython" (the one from example) MapBasic subroutine or function from python side?
It didn't work when I tried this
thisApplication.CallMapBasicSubroutine("FromPython", 1) # as a sub
or
thisApplication.CallMapBasicSubroutine("FromPythonFunc", 1) # changed to a function.
can someone please help? Thank you.
------------------------------
Ferhad Pakzat
BRITISH COLUMBIA HYDRO AND POWER AUTHORITY
Burnaby BC
------------------------------