[python-win32] Parameter problem

Mark Hammond mhammond at skippinet.com.au
Thu Jan 31 09:05:22 CET 2008


It would be good if you knew the IDL signature of the args - its not clear
if they are truly byref, or simply "out".  Named params might also be
getting in the way.

 

Try these - one might work :)

 

GetCentroid(first, scnd)

GetCentroid()

GetCentroid(pythoncom.Missing, pythoncom.Missing)

 

Mark

 

From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org] On Behalf Of Reinhammar Maria
Sent: Thursday, 31 January 2008 5:26 PM
To: python-win32 at python.org
Subject: [python-win32] Parameter problem

 

Hello all,

 

Not really sure that I have a problem with win32 Extensions here but
anyway..

(Please also note that I’m not very well versed with win32 nor COM, I merely
use it when

I develop Python apps that use COM objects.)

 

I try to call a method on the Solid Edge API, which provides a COM
interface.

In general, things work nicely, Thanks Mark for supplying win32 Extensions
:o)

 

The specific call expects two parameters by reference and these parameters

shall, upon return, contain the sought data.

Usually, I get the data as a returned tuple but this specific call instead
raise an exception(!)

 

>>> first = 1.0

>>> scnd = 1.0

>>> se.ActiveDocument.Sheets(3).ComplexStrings2d(10).GetCentroid(x=first,
y=scnd)

 

Traceback (most recent call last):

  File "<pyshell#7>", line 1, in <module>

    se.ActiveDocument.Sheets(3).ComplexStrings2d(10).GetCentroid(x=first,
y=scnd)

  File
"C:\Python25\lib\site-packages\win32com\gen_py\943AC5C6-F4DB-11D1-BE00-08003
6B4D502x0x1x0.py", line 3088, in GetCentroid

    , y)

  File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line
448, in _ApplyTypes_

    dispid, 0, wFlags, retType, argTypes, *args),

com_error: (-2147417851, 'The server threw an exception.', None, None)

 

 

Question: Where should I really look? Is it win32 Extensions or is it Solid
Edge?

Thought: The COM error states that the *server* threw exception so look
there BUT the call works from VB..

 

Using Python 2.5.1, pywin32-210, SolidEdge v18

 

PS.

In case someone out there happens to know about Solid Edge, the call is
object.GetCentroid(x, y) which is expected to return coordinates

for the object. The VB call looks like 

Dim dblx As Double
Dim dbly As Double

 

Call objCompStrn1.GetCentroid(x:=dblx, y:=dbly)

DS.

 

Maria Reinhammar
Software Engineer

Swisslog-Accalon AB

Box 135 
SE590 10 Boxholm 

Sweden

É Phone:   +46 (0)142 555 00 
É Direct:    +46 (0)142 556 08
Ê Fax:       +46 (0)142 555 55 
È Mobile:   +46 (0)703 99 84 65 
y Email:     <BLOCKED::mailto:Maria.Reinhammar at swisslog-accalon.com>
Maria.Reinhammar at swisslog-accalon.com 
ü Web:       <BLOCKED::http://www.swisslog-accalon.com>
http://www.swisslog-accalon.com 
²Skype:    accalonmar

****************************************************************************
********************

CONFIDENTIALITY AND DISCLAIMER

This e-mail and its attachments are intended for the above named
addressee(s) only and may be confidential. If the mail has come to you in
error please reply to this e-mail and highlight the error. In addition, we
kindly ask you to destroy the Mail. 

Please be aware that we disclaim all liability for the integrity or for the
accuracy of this Mail, as transmissions via Internet are not error free
communications medium. 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20080131/a15fdf29/attachment.htm 


More information about the python-win32 mailing list