I am trying to run a lisp routine I have used for some years to incrementally add or edit text
when I load the lisp I ge this error message:
Renum error: no function definition: VLAX-ENAME->VLA-OBJECT
I have tried repiaring the AutoCAd installation, I have even opened a copy of AutoCAD 2015 but I get the same response
Make sure to call (vl-load-com) somewhere at least once before trying to access other VL* functions.
Ref: http://www.afralisp.net/visual-lisp/tutorials/beginning-visual-lisp-part-1.php
I should make it clear - I didnt write the file, I downladed it about 2 years aga, it worked fine until I tried this week and now I get the error report
this is one of the files that no longer works
(defun c:renum (/ oldPref oldSuf oldStart curText curStr
numZeros)
(vl-load-com)
(initget 6)
(setq numZeros (getInt "\nEnter number of 0 prefix's:"))
(defun num2str (num / numStr)
(setq numStr (itoa num))
(If (< (strlen numStr) numZeros)
(repeat (- numZeros (strlen numStr))
(setq numStr (strcat "0" numStr))
)
)
numStr
)
(if(not rnm:Pref)(setq rnm:Pref ""))
(if(not rnm:Suf)(setq rnm:Suf ""))
(if(not rnm:Start)(setq rnm:Start 1))
(setq oldPref rnm:Pref
oldSuf rnm:Suf
oldStart rnm:Start); end setq
(setq rnm:Pref
(getstring T
(strcat "\nPrefix: <"rnm:Pref">: ")))
(if(= "" rnm:Pref)(setq rnm:Pref oldPref))
(if(= " " rnm:Pref)(setq rnm:Pref ""))
(setq rnm:Suf
(getstring T
(strcat "\nSuffix: <"rnm:Suf">: ")))
(if(= "" rnm:Suf)(setq rnm:Suf oldSuf))
(if(= " " rnm:Suf)(setq rnm:Suf ""))
(setq rnm:Start
(getint
(strcat "\nStarting number <"
(itoa rnm:Start)">: ")))
(if(null rnm:Start)(setq rnm:Start oldStart))
(while T
(setq curStr(strcat rnm:Pref(num2Str rnm:Start)rnm:Suf))
(setq curText
(car
(nentsel "\n<<< Pick TEXT, MTEXT or ATTRIBUTE or press Esc to quit >>> ")))
(if
(and
curText
(member(cdr(assoc 0(entget curText))) '("TEXT" "MTEXT" "ATTRIB"))
); end and
(progn
(vla-put-TextString
(vlax-ename->vla-object curText)curStr)
(setq rnm:Start(1+ rnm:Start))
); end progn
(princ "\n This is not DText or MText ")
); end if
); end while
(princ)
); end of c:renum
(princ "\n[Info] http:\\\\www.AsmiTools.com [Info]")
(princ "\n[Info] Renumber tool. Type RENUM to run. [Info]")
You didn't post the whole thing.
It's working fine for my 2008.
Look at the top part, it said not tested for next versions.
My suggestion is you ask the Customization Group.
It works fine here in AutoCAD 2016. There is nothing in that code version dependent.
It worked fine in 2012 2013 2015 and up until Tuesday it worked fine in 2016.
this is not the only lisp routine no longer working
I am trying to get the Autodesk support to pick this up because i think either an update has fubar'd the scenario or perhaps it's clashing with some other software, antivirus etc.
For the record I loaded my copy of 2008 that is still lurking on this m/c and they dont run on that either, or 2012 or 2013 or 2015.
no joy - error trace atached
<1> :ERROR-BREAK
[2] (VLAX-ENAME->VLA-OBJECT <Entity name: 7ffffb24ed0>)
[3] (C:RENUM)
<4> :CALLBACK-ENTRY
<5> :ARQ-SUBR-CALLBACK
I aparantlry am not worthy to be able to paste a screen dump
You're asking your question in the wrong place.
If it work before and not anynore, reset your autocad back to default, repair it or reinstall it.
If that isn't what you you want to do, then ask the people that know how to fix, they are here:
http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130
no joy - error trace atached
<1> :ERROR-BREAK
[2] (VLAX-ENAME->VLA-OBJECT <Entity name: 7ffffb24ed0>)
[3] (C:RENUM)
<4> :CALLBACK-ENTRY
<5> :ARQ-SUBR-CALLBACK
Presuming that the entity is valid, then yes, it appears that (vlax-ename->vla-object) is failing for some reason.
Since it's happening on all installs of AutoCAD, that makes me feel like this is a machine issue - like maybe a .DLL is being blocked by AV or something?
Are other computers in your office having the same problem? At the same time?
Patchy
Please
1. read my post fully - I have repaired/reinstalled etc
2. If you have nothing constructive to add, dont.
rkmcswain
I work from home, and am awaiting delivery of a new(new) machine, which I have had to return twice because it keeps arriving with the wrong software loaded, meanwhile I am keeping this one going with bailer twine and gaffer tape.
If it's a PC issue then I was hoping the "official" bods might know what the clash was, I have seen similar wih Acrobat in the past and had to delete some f its dll files. We run AVG anti-virus & use dropbox for file sharing, so whatever is causing this is recent.
I am having to manually label chainage markers on a few miles of rail as the surveys are no good in Civils 3D and I am forced back ito flat world. Hence my gruntle is a bit dissed and the lack of macros isn't helping.
thanks for your efforts, we shall see if a completely new build resolves it i guess.
Hi @Anonymous,
Thank you for posting your question here in the community forum.
The error you're encountering typically indicates an issue with the installation, caused by system cleanup tools. Do you use any registry cleaners or system cleanup programs? As @rkmcswain suggested, perhaps your antivirus program is interfering?
Typically, a repair of the AutoCAD installation should do the trick, however if the program that caused the error to begin with is still interfering, it's likely it will continue to do so until you disable it. Since you've already tried repairing the installation, if you repair or reinstall, be sure to disable any antivirus, security, registry cleaner, or system cleanup tools before doing so.
Can't find what you're looking for? Ask the community or share your knowledge.