M_Simons Posted December 1, 2011 Posted December 1, 2011 Have a question for the CAD geniuses out there... I posted this on the AutoDesk discussion board, with no response. I'm writing a giant autoLISP utility and I keep getting an intermittent ; error: bad argument type: numberp: nil in the c:ace_get_wnum API. It's difficult to troubleshoot as it doesn't happen all the time. It seems to happen on a "fresh" AutoCAD instance, and if I open the Project Wide Utilities dialog the error goes away and my program functions perfectly. All I have to do is open the dialog. It seems like this dialog loads something that the API needs. I have my program princ the input variable to this API right before it crashes and it seems to be correct input to the function namely: ; error: bad argument type: numberp: nil So it looks like the function is getting a correct entity name, but seems like it fails somewhere inside the API for whatever reason. Is there some way to find out why this API is failing? Any help eliminating this error would be greatly appreciated. FYI I'm running AutoCAD electrical 2009 Thanks! Quote
SLW210 Posted December 2, 2011 Posted December 2, 2011 I have moved this to the AutoLISP, Visual LISP & DCL forum. Quote
M_Simons Posted December 13, 2011 Author Posted December 13, 2011 Okay I think I have solved this... After digging around quite a bit here is what I found; c:ace_get_wnum API requires the function (wd_cfg_read_dwg_params) be executed before the API. I'm not entirely sure what this function does, I think it reads the WD_M block. Regardless it doesnt look like this function is executed on a "fresh" instance of ACE, so I had to call it in my program. Anyways, there you have it (if anyone else has the same problem). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.