CAD/CAM discussion forum > CAD > Get COM/OLE object for ZwCAD

Get COM/OLE object for ZwCAD

  Subscribe Topic

Rank: 1



posts: 1

Registered: 2014-7-31

Message 1 of 1

 Get COM/OLE object for ZwCAD
31-07-2014 09:28 . pm   |   View his/her posts only
I try take OLE object from zwcad, but have some problems.
return GetActiveObject(app_name)
except WindowsError:
return CreateObject(app_name)
except WindowsError:
return None

For AutoCAD app_name is "AutoCAD.Application". Application object is valid, I might add, remove, change any objects etc.

While try change app_name for Zwcad is returned "POINTER(IUnknown)".
I have ZwCAD 2012 and ZwCAD+ 2012 Pro. Using "OLE/COM Object Viewer" find names for ZwCAD:
For 2012 is: "ZWCAD.Application" or "ZWCAD.Application.2012" or GUID "{FB081ED6-0D7E-489F-A6B7-F7CEAEC10661}".
For 2012+ Pro is: "ZWCAD+.Application", "ZWCAD+.Application.2012" or GUID "{5A0AEDE3-DD95-4616-8D83-9A3DF35B0286}".

I use Python, package Comtypes, any of above application names work.

I see if a ZwCAD can`t provide a .tlb file.

Is any suggestion for help?
See also