Dear 孔欣驰, I might be wrong, but your question is more related to autoCAD rather than comtypes. In particular the use of "hatch.AppendOuterLoop([circle])" method. What type of arguments does it take? Could it be that the argument types you are passing are inappropriate?
What "circle" contains i.e. is it a list or an object? Try "hatch.AppendOuterLoop(circle)" or "hatch.AppendOuterLoop([circle, ])". Just shooting in the dark. I would suggest you reading the "AppendOuterLoop" method description. Cheers, Alkin On 26 Apr 2012, at 08:52, 孔欣驰 <kxc2...@gmail.com> wrote: > circle = doc.ModelSpace.AddCircle(array.array('d',[0,0,0]), 100) > hatch = doc.ModelSpace.AddHatch(2, "AR-CONC", False) > hatch.AppendOuterLoop([circle]) > hatch.Evaluate > > I want addhatch to a circle in CAD, but when I call > hatch.AppendOuterLoop([circle]), comtypes raise a COMError: > > COMError: (-2145320837, None, (u'\u5bf9\u8c61\u6570\u7ec4\u65e0\u6548', > u'AutoCAD.Application', u'C:\\Program Files\\AutoCAD > 2008\\HELP\\OLE_ERR.CHM', -2145320837, None)) > > How can I call "AppendOuterLoop" in right way? > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > comtypes-users mailing list > comtypes-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/comtypes-users ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users