Shane0000 Posted August 16, 2012 Share Posted August 16, 2012 Not sure what this error is telling me, Most the code below works up to:$oAcadActDoc.SummaryInfo.addCustomSummaryInfo($tTemp3,$tTemp4)And thats where I get the COM error 80020006, description 'UNKNOW NAME.'.(additional info on method 'addCustomSummaryInfo': http://docs.autodesk.com/ACDMAC/2012/ENU/ObjectARX%20Reference/index.html?frmname=topic&frmfile=!!MEMBERTYPE_Methods_AcDbDatabaseSummaryInfo.html)Thank you for any insights.expandcollapse popup$oMyError = ObjEvent("AutoIt.Error","MyErrFunc"); Install a custom error handler Dim $oAcad $oAcad = ObjGet("","AutoCAD.Application") If Not IsObj($oAcad) Then $oAcad = ObjCreate("AutoCAD.Application") If NOT IsObj($oAcad) Then msgbox(0,"0010","error capturing autocad") EndIf EndIf $oAcadActDoc_Cnt = $oAcad.documents.count $oAcadActDoc = $oAcad.activedocument $oAcadBlocks = $oAcadActDoc.blocks msgbox(0,"$oAcad.activedocument",$oAcad.activedocument.Name) Local Const $iSize0 = StringLen('Key') + 1 Local Const $iSize1 = StringLen('value') + 1 Local Const $tTemp3 = DllStructCreate("wchar[" & $iSize0 & "]") Local Const $tTemp4 = DllStructCreate("wchar[" & $iSize1 & "]") DllStructSetData($tTemp3, 1, "Key") DllStructSetData($tTemp4, 1, "Value") msgbox(0,"test",DllStructGetData ($tTemp4, 1)) msgbox(0,"testing","Custom entries: "& $oAcadActDoc.SummaryInfo.NumCustomInfo ,3) $oAcadActDoc.SummaryInfo.addCustomSummaryInfo($tTemp3,$tTemp4) For $i = 1 to $oAcadActDoc.SummaryInfo.NumCustomInfo - 1 $oAcadActDoc.SummaryInfo.getCustomSummaryInfo($i,$tTemp3,$tTemp4) ;Msgbox(0,"test returns",$tTemp1 &@CRLF&$tTemp2) ;$oAcadActDoc.SummaryInfo.deleteCustomSummaryInfo() ;msgbox(0,"testing","Custom entries: "& $oAcadActDoc.SummaryInfo.NumCustomInfo ,1) Next ;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ Com Error Handler ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Local $err = $oMyError.number If $err = 0 Then $err = -1 SetError($err) EndfuncAcDbDatabaseSummaryInfo::addCustomSummaryInfo C++ virtual Acad::ErrorStatus addCustomSummaryInfo( const ACHAR* key, const ACHAR* value ) = 0; Parameters const ACHAR* key Input key or name of the custom field to add to the list of custom fields const ACHAR* value Input value or contents of the custom field Link to comment Share on other sites More sharing options...
Shane0000 Posted August 18, 2012 Author Share Posted August 18, 2012 (edited) Just so there is some sort of resolution to this thread:I believe this error came from trying to interact with an APP in away that was incompatible with Auto-It.This error came from calling an erroneous method name.Ie: .addCustomSummaryInfo is really .AddCustomInfoThe below will now correctly add custom info to the drawing propertiesDim $oAcad $oAcad = ObjGet("","AutoCAD.Application") If Not IsObj($oAcad) Then $oAcad = ObjCreate("AutoCAD.Application") If NOT IsObj($oAcad) Then msgbox(0,"0010","error capturing autocad") EndIf EndIf $oAcadActDoc = $oAcad.activedocument $tTemp7 = 'me2ewh' $tTemp8 = 'goddgwogogo' $oAcadActDoc.SummaryInfo.AddCustomInfo ($tTemp7,$tTemp8) Edited August 19, 2012 by Shane0000 Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 18, 2012 Share Posted August 18, 2012 Now that you linked the documentation, I don't believe these are COM objects at all. They look like C++ classes. Link to comment Share on other sites More sharing options...
Shane0000 Posted August 18, 2012 Author Share Posted August 18, 2012 (edited) I think the C++ maybe an example? but I interact with them through Arx (This is Acads ObjARX), I can call and recieve data for most of the commands until I upgraded from Acad2007 to Acad2012, The calls all worked (below). Now that AutoCad requires Unicode to interact with the ObjectArx I cant get (most) data to and from the target app (AutoCad). Aslong as the ObjArx methods do not require Unicode, I can pass data back and forth. $oAcadActDoc_Cnt = $oAcad.documents.count ;returns correctly $oAcadActDoc = $oAcad.activedocument ; returns correctly $oAcadActDoc.SummaryInfo.NumCustomInfo ; returns correctly $oAcadActDoc.SummaryInfo.getCustomSummaryInfo($i,$temp1,$temp2); fails, requires unicode also requires Unicode Variable Containers [$tamp1,$temp2 (incompatible with AutoIt, Im told)] $oAcadActDoc.SummaryInfo.addCustomSummaryInfo($arrCtrlID_Key[$i], $CtrlIDArray[$i]) ; fails, requires unicode That Code Summary is from AutoCads Object Arx Reference Guide http://docs.autodesk.com/ACDMAC/2012/ENU/ObjectARX%20Reference/index.html?frmname=topic&frmfile=!!MEMBERTYPE_Methods_AcDbDatabaseSummaryInfo.html Edited August 18, 2012 by Shane0000 Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 18, 2012 Share Posted August 18, 2012 You may need this. http://support.microsoft.com/kb/138813 Shane0000 1 Link to comment Share on other sites More sharing options...
Shane0000 Posted August 18, 2012 Author Share Posted August 18, 2012 Thanks for the info, I dont think its in my skill set to apply that info to autoit at the moment so Ill put 'er on the ole back burner. Ive really never worked w/ C and very little in VB so I may try a LiSP solution (native Acad language) until I get a little more knowledge in my head. Thanks for the time and info. Shane Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 19, 2012 Share Posted August 19, 2012 LISP is probably a great idea. trancexx 1 Link to comment Share on other sites More sharing options...
trancexx Posted August 19, 2012 Share Posted August 19, 2012 Quick google search suggests you are using wrong methods names. For example AddCustomInfo, GetCustomByIndex, GetCustomByKey appear to be names of some methods that object exposes....And you don't need things from Richard Robertson's link. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Shane0000 Posted August 19, 2012 Author Share Posted August 19, 2012 (edited) Ahh, well thank you. I was using Autocad's Arx Reference's methods as a guide to google for answers so thats why I never came across that set of methods.Im not sure why AutoCads Arx Reference says to use: 'addCustomSummaryInfo' vs 'AddCustomInfo'. Other methods for the same object worked as the Arx Ref had stated ..... [ which Is why I thought I was on the right track ]Googling those methods (you showed) reminded me (been a few years since i programmed) of dumping objects to get there methods inside autocad and sure enough, the correct name is as you suggested.Getting 'ended.rc:-1073741819' errors but one step closer right [plenty of google to go through :| ]Adding the data to AutoCad is the most important thing (which now works!) so,Once again, Big thanks for the helpThe below will now correctly add custom info to the drawing propertiesDim $oAcad $oAcad = ObjGet("","AutoCAD.Application") If Not IsObj($oAcad) Then $oAcad = ObjCreate("AutoCAD.Application") If NOT IsObj($oAcad) Then msgbox(0,"0010","error capturing autocad") EndIf EndIf $oAcadActDoc = $oAcad.activedocument $tTemp7 = 'me2ewh' $tTemp8 = 'goddgwogogo' $oAcadActDoc.SummaryInfo.AddCustomInfo ($tTemp7,$tTemp8) Edited August 19, 2012 by Shane0000 Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 20, 2012 Share Posted August 20, 2012 ...And you don't need things from Richard Robertson's link.I had honestly hoped not since I thought AutoIt handled all the type casting for COM internally. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now