Client side COM and Python Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    #1

    Client side COM and Python Problem

    Hey Guys, Im new to working with com but i only want to do one thing.

    I have activestate python and am trying to get python to run a simple
    function in a com enabled 3d program called 3dsmax. If i try and
    execute a function over the com interface it works fine as long as i
    dont try and run the function with an argument. when i run it with an
    argument like so. "o.mypingmax("t est string")" it gives me an error in
    my client app and an error in python.

    please help me understand this error and what i am doing wrong? I have
    tried a similar script in another language and it works. but python
    does not like it.

    #code
    import win32com.client
    o = win32com.client .Dispatch("MAX. Application.8")
    o.mypingmax("te st string")

    # Python Error

    Traceback (most recent call last):
    File "<interacti ve input>", line 1, in ?
    File "C:\Python24\li b\site-packages\win32c om\client\dynam ic.py", line
    491, in __getattr__
    raise pythoncom.com_e rror, details
    com_error: (-2147220992, 'CONNECT_E_NOCO NNECTION', None, None)

    #client Application error (3dsmax script output)

    -- Argument count error: mypingmax wanted 1, got 0
    during OLE automation function call

    Sorry if its blindingly obvious but i just cant work out what is going on.

    Cheers,

    Mark


Working...