MapInfo Pro Developers User Group

Welcome to the MapInfo Pro Developers community!  We are a group dedicated to the discussion and understanding of MapBasic and .Net MapInfoPro AddIn development. Bring your questions and ideas here. This group includes several members of the Pro development team from around the world.

Please feel free to start a discussion in the discussion tab or join in a conversation.

MapInfo Community Downloads

 View Only

Functionality of New_PythonAddin() and InitializePyAddin()

  • 1.  Functionality of New_PythonAddin() and InitializePyAddin()

    Posted 09-20-2023 05:45

    Hi,

    I'm trying to implement a custom MapBasic application written entirely in Python, I've created my MapBasic entry point into the Python code based off of the Python Ribbon example found in:

    \MapBasic\Samples\RIBBONINTERFACE\Python\py_ribbon_customization

    I had a few questions about the following functions:

    New_PythonAddin()

    InitializePyAddin()

    These are obviously used to load the Python module into the MapBasic environment and execute it. But why are they separate? What are the specific behaviours of New_PythonAddin(), does it just return an empty object to be initialised by InitializePyAddin()? Is there a way to specify the python module to be loaded? Why exactly do we need an empty object for the python module to have access to the MapInfo process if we are passing it a reference anyway in the second parameter of InitializePyAddin()?



    ------------------------------
    Romano Agostini
    Knowledge Community Shared Account
    ------------------------------