List Info

Thread: Trouble Automating Alibre CAD package




Trouble Automating Alibre CAD package
user name
2006-07-06 03:10:23
Hello,

I am trying to use pywin32 to automate a CAD package from
Alibre (www.alibre.com) called Design Express.

The documentation I can get is written for Visual Basic (and
not all that well at that), and I get the following error
from the following lines:

[Python Code]
        import win32com.client
                       
AlibreObject=win32com.client.Dispatch(r"AlibreX.Automa
tionHook")
[End Python code]

Error traceback:
    AlibreObject =
win32com.client.Dispatch(r"AlibreX.AutomationHook&quo
t;)
  File
"C:\Python24\Lib\site-packages\win32com\client\_
_init__.py", line 95, in Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx
)
  File
"C:\Python24\Lib\site-packages\win32com\client\d
ynamic.py", line 98, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File
"C:\Python24\Lib\site-packages\win32com\client\d
ynamic.py", line 78, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None,
clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147467262, 'No such interface
supported', None, None)


Any ideas what to try next?

Thanks,
Duane


_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32
Trouble Automating Alibre CAD package
user name
2006-07-12 11:22:41
duanekchorus.net schrieb:
> Hello,
> 
> I am trying to use pywin32 to automate a CAD package
from Alibre (www.alibre.com) called Design Express.
> 
> The documentation I can get is written for Visual Basic
(and not all that well at that), and I get the following
error from the following lines:
> 
> [Python Code]
>         import win32com.client
>                        
AlibreObject=win32com.client.Dispatch(r"AlibreX.Automa
tionHook")
> [End Python code]
> 
> Error traceback:
>     AlibreObject =
win32com.client.Dispatch(r"AlibreX.AutomationHook&quo
t;)
>   File
"C:\Python24\Lib\site-packages\win32com\client\_
_init__.py", line 95, in Dispatch
>     dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx
)
>   File
"C:\Python24\Lib\site-packages\win32com\client\d
ynamic.py", line 98, in _GetGoodDispatchAndUserName
>     return (_GetGoodDispatch(IDispatch, clsctx),
userName)
>   File
"C:\Python24\Lib\site-packages\win32com\client\d
ynamic.py", line 78, in _GetGoodDispatch
>     IDispatch = pythoncom.CoCreateInstance(IDispatch,
None, clsctx, pythoncom.IID_IDispatch)
> pywintypes.com_error: (-2147467262, 'No such interface
supported', None, None)
> 

The problem seems that the COM object that Alibre implements
is buggy.  According to the
type library (I've installed the free Express version) the
call above should return an
object that implements the IAutomationHook interface, which
is derived from IDispatch:

[
  odl,
  uuid(424539A8-7014-4174-B0BF-F5EE5BB71DF5),
  helpstring("IAutomationHook interface"),
  dual,
  oleautomation
]
interface IAutomationHook : IDispatch {
    [id(0x00000001), propget, helpstring("Returns the
automation root")]
    HRESULT Root([out, retval] IDispatch** ppRoot);
    [id(0x00000002), helpstring("Initiates a new
Alibre Design Automation client")]
    HRESULT Initialize(
                    [in] BSTR serverURL, 
                    [in] BSTR loginID, 
                    [in] BSTR passwd, 
                    [in] VARIANT_BOOL disableSecureMode, 
                    [in] int unused);
    [id(0x00000003), helpstring("Initiates a new Debug
client")]
    HRESULT InitializeDebug(
                    [in] BSTR serverURL, 
                    [in] BSTR loginID, 
                    [in] BSTR passwd, 
                    [in] VARIANT_BOOL disableSecureMode, 
                    [in] int unused);
};

Experiments with comtypes (the ctypes com framework) show
that the
object can successfully be QueryInterface'd for
IAutomationHook, but not
for IDispatch.  I'm not sure pywin32 can handle such a
buggy object,
but you could probably try to run makepy on the typelib and
then
create the object.  Others may have more knowledge if or how
this
would work.

Thomas

_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32
Trouble Automating Alibre CAD package
user name
2006-07-12 11:40:19
duanekchorus.net schrieb:
> > Hello,
> > 
> > I am trying to use pywin32 to automate a CAD
package from Alibre (www.alibre.com) called Design Express.
> > 
> > The documentation I can get is written for Visual
Basic (and not all that well at that), and I get the
following error from the following lines:
> > 
> > [Python Code]
> >         import win32com.client
> >                        
AlibreObject=win32com.client.Dispatch(r"AlibreX.Automa
tionHook")
> > [End Python code]
> > 
> > Error traceback:
> >     AlibreObject =
win32com.client.Dispatch(r"AlibreX.AutomationHook&quo
t;)
> >   File
"C:\Python24\Lib\site-packages\win32com\client\_
_init__.py", line 95, in Dispatch
> >     dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx
)
> >   File
"C:\Python24\Lib\site-packages\win32com\client\d
ynamic.py", line 98, in _GetGoodDispatchAndUserName
> >     return (_GetGoodDispatch(IDispatch, clsctx),
userName)
> >   File
"C:\Python24\Lib\site-packages\win32com\client\d
ynamic.py", line 78, in _GetGoodDispatch
> >     IDispatch =
pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
> > pywintypes.com_error: (-2147467262, 'No such
interface supported', None, None)
> > 

The problem seems that the COM object that Alibre implements
is buggy.  According to the
type library (I've installed the free Express version) the
call above should return an
object that implements the IAutomationHook interface, which
is derived from IDispatch:

[
  odl,
  uuid(424539A8-7014-4174-B0BF-F5EE5BB71DF5),
  helpstring("IAutomationHook interface"),
  dual,
  oleautomation
]
interface IAutomationHook : IDispatch {
    [id(0x00000001), propget, helpstring("Returns the
automation root")]
    HRESULT Root([out, retval] IDispatch** ppRoot);
    [id(0x00000002), helpstring("Initiates a new
Alibre Design Automation client")]
    HRESULT Initialize(
                    [in] BSTR serverURL, 
                    [in] BSTR loginID, 
                    [in] BSTR passwd, 
                    [in] VARIANT_BOOL disableSecureMode, 
                    [in] int unused);
    [id(0x00000003), helpstring("Initiates a new Debug
client")]
    HRESULT InitializeDebug(
                    [in] BSTR serverURL, 
                    [in] BSTR loginID, 
                    [in] BSTR passwd, 
                    [in] VARIANT_BOOL disableSecureMode, 
                    [in] int unused);
};

Experiments with comtypes (the ctypes com framework) show
that the
object can successfully be QueryInterface'd for
IAutomationHook, but not
for IDispatch.  I'm not sure pywin32 can handle such a
buggy object,
but you could probably try to run makepy on the typelib and
then
create the object.  Others may have more knowledge if or how
this
would work.

Thomas

_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )