Jump to content
dancad10

error: bad argument type: VLA-OBJECT nil - in autocad 2014

Recommended Posts

dancad10

Hi, i have an problem with lisp that i have to load in autocad and is give me this error "error: bad argument type: VLA-OBJECT nil".

I don't now why, i have not been able to solve the problem.

I will attach the file .. maybe someone will now.

Thank you!

Utils-700V105.lsp

Share this post


Link to post
Share on other sites
Emmanuel Delay

when using which function?

Share this post


Link to post
Share on other sites
dancad10

This is showing me when i tap pg in comand bar.

With pg i introduce some infromation for parcels

error PG comand in autocad.jpg

Share this post


Link to post
Share on other sites
Emmanuel Delay

A problem is that this function loads two (as far as I looked at) files. 

Optiuni_Utils.lsp & county.xml

  • Thanks 1

Share this post


Link to post
Share on other sites
ronjonp

On line 2853 .. if you miss a pick it will cause this error. You always need to make sure you're passing a valid ename to that function.

image.thumb.png.fcdf86ddbea0ad7897dbdf1dd9bfaee5.png

Quick fix would be to include  this sub in the code:

(defun _vla-object (ename)
  (if (= 'ename (type ename))
    (vlax-ename->vla-object ename)
  )
)

Then do a find and replace of 'vlax-ename->vla-object' with '_vla-object'.

  • Thanks 1

Share this post


Link to post
Share on other sites
BIGAL

Wow ronjonp found a problem on line  2853 you must have a lot of time. PG starts at line 8268

 

It looks like every single routine has been put into 1 routine, not sure what sort of memory overhead that introduces, as posted when something goes wrong where do you start particuarly if your not the author. 

  • Thanks 1

Share this post


Link to post
Share on other sites
dancad10

Thank you all, for respond my problem i will see if i could fix with your clues.

Share this post


Link to post
Share on other sites
ronjonp
10 hours ago, BIGAL said:

Wow ronjonp found a problem on line  2853 you must have a lot of time. ...

 

...

I spent about 2 minutes on the problem 😉 there are many other places this code can fail ... the OP needs to use break on error in the vlide to troubleshoot this. 11400 lines in the code posted!

image.png.f32100beeca032f937a4a518dce44b33.png

  • Confused 1

Share this post


Link to post
Share on other sites
Lee Mac

Wow, what a mess! 😮

Share this post


Link to post
Share on other sites
rlx

if I type PG it fails on line 11106 (c:loadxml) :


(vlax-import-type-library
        :tlb-filename "c:/Lisp-700/dll/msxml6.dll"
        :methods-prefix "xmlm-"
        :properties-prefix "xmlp-"
        :constants-prefix "xmlc-"
      )

I don't have file "c:/Lisp-700/dll/msxml6.dll" ... do you?

Share this post


Link to post
Share on other sites
BIGAL

No idea what is making it.

image.thumb.png.3580803726b4edebdaaa2281ea6935ce.png

Share this post


Link to post
Share on other sites
rlx

google tells msxml6.dll can be installed by user for a number of products : Windows Server 2003 servicepack 2; Windows XP servicepack 2 , what it's for...I dunno exactly.

 

But besides code from OP is long , its in a foreign language and its poorly (not!) documented so chances of ever fixing something aren't that good either.

Share this post


Link to post
Share on other sites
dancad10

Hey people about this PG comand i kind a solved the mistery, it have give the error because i didn't loaded properly. I never used this lisp.

So it's ok like this, and i have "msxml6.dll" file that rlx mention about.

 

Share this post


Link to post
Share on other sites
BIGAL

Someone went to a lot of effort did they not write a "How to use" document ?

 

Or is it you got it from someone, who got it from someone, who got it from some one.

Share this post


Link to post
Share on other sites
dancad10

Got it from someone from someone ... 

On other computer its working with zwcad 2015, and i want to use it in autocad.

This comand insert some layouts, with diferent contexts, i copied that folder with this lisp that its works  on zwcad and still its not done. I dont now how ......

Share this post


Link to post
Share on other sites
BIGAL
Posted (edited)

If you want just a little bit to work then open two notepad, in one your code, in the other paste each defun section of code for the command you want then it can probably be debugged. Make a small version of the code is what I am saying.

 

you will have to look carefully at each line put each called defun inserted at top of code, the layout defun should be the last one.

 

Which command do you use to start .

Edited by BIGAL

Share this post


Link to post
Share on other sites
dancad10

HEY guys its works now i think there is no problem. It was all about my autocad, i have to uninstal and instaled again. The code its good.

Thanks BIGAL, and all.

 

Share this post


Link to post
Share on other sites
BIGAL

Thats like a last resort but good its working.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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