[python-win32] Parameter problem

Reinhammar Maria maria.reinhammar at swisslog-accalon.com
Thu Jan 31 07:26:09 CET 2008


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-0
80036B4D502x0x1x0.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 
* Email:    Maria.Reinhammar at swisslog-accalon.com
<BLOCKED::mailto:Maria.Reinhammar at swisslog-accalon.com>  
* Web:      http://www.swisslog-accalon.com
<BLOCKED::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/b4e70834/attachment-0001.htm 


More information about the python-win32 mailing list