Jump to content

Recommended Posts

Posted

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!

Posted

I have moved this to the AutoLISP, Visual LISP & DCL forum.

  • 2 weeks later...
Posted

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).

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...