VLAX-ENAME->VLA-OBJECT no function definition

VLAX-ENAME->VLA-OBJECT no function definition

Anonymous
Not applicable
7,982 Views
43 Replies
Message 1 of 44

VLAX-ENAME->VLA-OBJECT no function definition

Anonymous
Not applicable

at my work we've got a bunch of programs that use that to collect data, and our startup script does call in (vl-load-com) however, randomly (and I can't figure out why) it seems to drop vlax-ename->vla-object from its list of valid commands. the only "solution" i've been able to find so far has been to uninstall and reinstall the latest patch (using autocad 2015 x64) 

 

is there some sort of more permanent fix out there?

0 Likes
7,983 Views
43 Replies
Replies (43)
Message 21 of 44

Anonymous
Not applicable

@john.uhden none of our programs (as far as I'm aware) use setenv for anything, and this particular program was the second last program i used yesterday (just checked in the last program i had used yesterday) and it had worked fine, tried running it this morning, and vlax-ename had fallen over.

 

I did file compares of the individual requested sections from above - and couldn't find any real differences (again, other than entries for artcam and everything it had installed) and it had fallen apart when i tried to compare the full registry (an over 350mb file)

0 Likes
Message 22 of 44

john.uhden
Mentor
Mentor

I doubt there is any reason to compare the full registry unless you are masochistic.

I will keep thinking for you but my brain has fallover days too (read below).

 

I don't know if any of us has asked, but are there any other vl* functions that fall over also?

This is a stretch, but might your installation file be faulty?

Have you filed a report to Autodesk?

Have you recently walked under a ladder or had a black cat cross your path?

Did you use the Lord's name in vain?

Have you been searching for hidden treasure on Oak Island?

Did you vote for Hillary?

 

John F. Uhden

0 Likes
Message 23 of 44

martti.halminen
Collaborator
Collaborator

 

NIL is in this case the worst case: it gives no additional information. If there had been some other value, it would have been a clear case of overwriting.

With nil we can't differentiate between an unbound variable and a variable being setq to nil.

 

I've occasionally seen something possibly related: when jumping between various AutoCAD windows, sometimes it looks like the context switch hasn't finished correctly, leaving some parts of the Lisp environment unloaded. But those usually get cleared by a little more jumping between windows.

 

Another question: when this disappears, is it permanently gone, or does re-starting AutoCAD bring it back?

Also, when this disappears, does it do so just in one window, or in every separate AutoCAD window?

 

If this is just a runtime problem, you could store the vlax-ename->vla object function definition into some other variable in your acaddoc.lsp, and anywhere you call vlax-ename->vla object , first run a sanity check on that and replace it from the spare copy if it has disappeared.

 

--

 

Message 24 of 44

john.uhden
Mentor
Mentor

Very wise observations and questions!!  (much more valuable than mine :/)

John F. Uhden

0 Likes
Message 25 of 44

Anonymous
Not applicable

@martti.halminenwhen it's gone, its gone, app restarts, computer reboots, nothing brings it back (and today it was literally the second drawing i opened for the day- first was just a blank template) and every autocad session, variable just... gets unassigned...somehow... and sanity check is the other 5 people in my department not having issues with it (had to get one of our other guys to run the command on the drawing i was working on, while i was troubleshooting, no problems for him)

 

@john.uhden- haven't seen any other vl* commands fall over, other than this one, i'll have to look tomorrow at what vl* commands our tracking program uses. and to answer the rest...

installation i'm starting to get suspicious of, as am some possible hardware error (it's a new computer, never ran into the issue on my old computer...but it was also still only running 2006)

no, i haven't filed a report to autodesk- partially because... i'm not even sure how to approach them on this, haha

havent recently walked under any ladders, havent crossed the path of any black cats (that i'm aware of)

have used the lords name in vain

where's oak island? and there's treasure? im in!

can't vote in US elections...i'm a canuck

0 Likes
Message 26 of 44

john.uhden
Mentor
Mentor

"The Curse of Oak Island"is a current TV miniseries where these dudes are spending megabucks trying to locate the "Treasure Pit" I think somewhere off of New Brunswick."  I'm sure they would be doing better if they had a decent AutoCAD dwg and could xref in some good old Spanish DXF treasure maps. I think they keep failing because they can't translate the entities they have found into objects, or something like that.  :]  It's probably because the Knights Templar hid everything inside the Lost Arc (or was that Spline?).  In a future episode I think they will call in Dr. Henry Jones (from Indiana).  But the Germans are sure to abscond with it all in a yellow submarine.  They all live there, you know.

John F. Uhden

0 Likes
Message 27 of 44

martti.halminen
Collaborator
Collaborator

 

This is starting to look like something that needs Autodesk help, this requires knowledge of where the failing function should be at runtime and how it should be loaded.

 

While hardware failure might be possible, this is oddly specific for that. A memory error would repeat at the next runtime only if AutoCAD was always loaded at the same address. I don't know enough about Windows internals to know whether it might force AutoCAD to the same location.

- What happens if you first start ten other programs and then try AutoCAD?

[Another possibility of a memory error propagating to another session would be if they are working with memory-mapped files. Checking this would take a bit-level comparison with a non-broken system, much easier if you know the place...]

A disk error would explain a situation where this is broken from a start, but not a situation where it starts correctly and fails later at runtime. And the probability of getting a disk error causing the same failure at separate computers is extremely small.

 

So, my guess would be that something is messing with the AutoCAD bookkeeping of what to load where.

- You might compare the Loaded Applications -list in APPLOAD between a working and a broken installation.

 

-- 

 

0 Likes
Message 28 of 44

dbroad
Mentor
Mentor

My guess is that somewhere in your lisp programs, someone deleted a parenthesis  and added it back in without really thinking about what they were doing, or  put a comment somewhere resulting effectively in:

 

(setq vlax-ename->vla-object nil)

 

 

The trouble is that you won't be able to look for that sequence.  Some overly ambitious lisp programmers string out their setq's to many lines with lots of nested behaviors so doing a find won't work.  You will  have to search for vlax-ename->vla-object  and determine contextually whether it is getting assigned the nil result from another expression.  For example:

 

(setq    ;my_var  commenting out a variable instead of explaining what the variable name means

  vlax-ename->vla-object  ;;forgetting a parenthesis

     null_ename  ;;any expression resulting in nil but this is most logical, especially when single letter var names are reused.

 );;setq  closure somewhere

 

I would also be surprised that you really need a reinstall vs just reloading the autocad application.  One way to test whether your AutoCAD really needs to be reinstalled is to set up a profile that has none of your customization directories available so that no ACAD.LSP or ACADDOC.LSP gets loaded, nor any other custom lisp written by your company, including any autodesk autolisp files modified by your company (I hope you haven't made that bad decision).  Then in vlide, at the command console, just enter vlax-ename->vla-object and look at the return value.  If that doesn't work use the vlide apropos and look for vlax-ename and look at the list.

    

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 29 of 44

Anonymous
Not applicable

@dbroad that's a great theory, but still doesn't explain how it would stop functioning for me, but still be functioning perfectly fine for other users in my department (who also use a great deal more lisp programs than i do - and by your theory, would have more likelyhood of it occurring).

 

I will try the "virgin profile" idea as well, if/when it happens again

0 Likes
Message 30 of 44

dbroad
Mentor
Mentor

If it is caused by an autolisp file badly edited, it may not have been distributed to all users.  

 

If it happens after you switch to a bad profile with certain support folders having higher priorities, then restarting autocad wouldn't help until you changed profiles.  That is why I suggest a minimal testing profile or set up a test folder with a blank acaddoc.lsp and blank acad.lsp file and launch autocad in that folder.

 

As to why, its always possible someone has a bad sense of humor or a grudge.  Perhaps you are using a particular program that causes the problems that the others aren't.

 

Track back to when the problems start and look for customization files that were changed in the weeks or days immediately preceding that date.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 31 of 44

stevor
Collaborator
Collaborator
From the command line: (type vlax-ename->vla-object) returns SUBR
S
0 Likes
Message 32 of 44

john.uhden
Mentor
Mentor

I was thinking that maybe VL.ARX wasn't getting loaded, or maybe some other file, so ...

I used my ZTree to search all the AutoCAD program files for "vlax-ename->vla-object" and came up with only example AutoLisp files.

So I can't tell what file creates the function.

 

Did i ask if other vl* functions disappear also?

 

Attached is my LISTFUNS.lsp to help you find out.

After loading, just type the command "LF" and for the search spec use "vl*"

John F. Uhden

0 Likes
Message 33 of 44

Anonymous
Not applicable

yes, you had asked if anything else disappears- and from what i've been able to tell, nothing else had. i'll keep that file in mind for if/when it happens again. thanks.

0 Likes
Message 34 of 44

john.uhden
Mentor
Mentor

Well then, from what you have been able to tell us, it seems that @dbroad's analysis seems most accurate.

John F. Uhden

0 Likes
Message 35 of 44

phanaem
Collaborator
Collaborator

Hi Steven

 

I try to solve the same issue for a client of mine. He uses AutoCAD 2017, fresh new installed, without any customization.

That is, no custom Profile, no personalized acaddoc.lsp or acad.lsp.

 

He reported the same error: no function definition VLAX-ENAME->VLA-OBJECT.

 

From what I've read about this error, it is an install problem, but I didn't find any fix for it.

I'm trying to collect any information that might help, so please run this test and post the result.

 

(defun C:VLTEST ()
  (vl-load-com)
  (princ "\n*************Start test*************")
(foreach x (atoms-family 0) (or (eval x) print x)) )
(princ "\n*************End test***************")
(textscr) (princ) )

Thank you very much.

 

0 Likes
Message 36 of 44

john.uhden
Mentor
Mentor
(or (eval x) (print x))

 

John F. Uhden

0 Likes
Message 37 of 44

phanaem
Collaborator
Collaborator

@john.uhden wrote:
(or (eval x) (print x))

 


Oh, yes... Edited in place, my mistake. Thank you, John.

 

This is the correct one

 

(defun C:VLTEST ()
  (vl-load-com)
  (princ "\n*************Start test*************")

  (foreach x (atoms-family 0)
    (or (eval x) (print x))
  )

  (princ "\n*************End test***************")
  (textscr)
  (princ)
)

 

0 Likes
Message 38 of 44

ActivistInvestor
Mentor
Mentor
My suggestion would be to ask your in-house LISP progammer if he can create a lisp program that uses the VLR-CommandEnded reactor notification to detect precisely when the VLAX-ENAME->VLA-OBJECT symbol has become Nil.

I've used that technique numerous times to sniff out rogue LISP macros that were reassigning values to protected symbols.
0 Likes
Message 39 of 44

Anonymous
Not applicable

I have the same problem in freshly installed AutoCAD Civil 3D 2017 with SP 1.1.

Previously I experienced the same problem on my old Win 10 installation and uninstalling SP 1.1 helped for a while.

When error appeared again, re-installing SP 1.1 helped, and so on.

Finally after playing around with these installs I had quite period for about 1-2 months and now on fresh Windows it came back again.

Have no other clues except playing again with re-installing, as all LISP is well tested and used for years on numerous machines.

0 Likes
Message 40 of 44

kpennell
Collaborator
Collaborator
Phanaem,
 
 
I have loaded your suggested VLTEST code into a drawing using a 'working' computer, this gets returned.
 
*************Start test*************
*************End test***************
 
 
When I loaded your VLTEST code on to an 'infected' machine, I get the same returned.
 
0 Likes