VLAX-ENAME->VLA-OBJECT no function definition

VLAX-ENAME->VLA-OBJECT no function definition

Anonymous
Not applicable
7,985 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,986 Views
43 Replies
Replies (43)
Message 41 of 44

Scottu2
Advocate
Advocate

Steven,

 

I encountered this problem last year on different stations.  It was that installing 2015 would fix the problem it did... for few months.

Last week I had an acad electrical with this same problem plus the undo being disabled and the special electrical edit component routines not working.

After 2 hours with Autodesk we determined the original profile was corrupted, <<acade>>.

 

The following may work for you:

Open autocad

Options - Profiles - set <<vanilla>> as current

Delete the <<acade>> or <<acad>> profile

Close and restart autocad.... the <<acade>> profile message says its missing, click OK (because autocad will rebuild it).

close autocad  (doe this so that autocad saves information to the registry when it exits, ie system variables, tool-palette)

 

start autocad

see VLAX-ENAME->VLA-OBJECT works (lucky if it does)

Close autocad

 

go to the windows control panel to uninstall autocad, but Select the REINSTALL (10-20 minutes).

start autocad

see VLAX-ENAME->VLA-OBJECT works

Done.

 

Note: if your startup icon loads a different profile other than /p <<acade>> make sure its loading the default.

It is also possible that all the other profiles create are bad too.

 

Good luck

 

Message 42 of 44

ActivistInvestor
Mentor
Mentor

You can try this diagnostics tool, which has saved my tail more times than I can remember.

 

When a rogue LISP script changes the value of the monitored symbol, you will see a message on the console.

 

You can add this to any .LSP file that loads at startup, to automate logging:

 

 

    (load "varmon.lsp")
    (varmon 'vlax-ename->vla-object)

 

;; varmon.lsp
;;
;; Monitors the value of a LISP variable, and displays a message 
;; indicating its value has changed.
;;
;; This code is not intended for production use of AutoCAD. It is
;; intended to diagnose problems caused by rouge LISP scripting 
;; that assigns values to protected/reserved symbols (e.g. symbols 
;; assigned to LISP functions, symbols defined by importing a type 
;; library, or symbols initialized to some value by Visual LISP).
;;
;; This code probably contains bugs.
;; Any use of this code is undertaken at the users own risk.
;;
;; To use VARMON.LSP, load it, then enter the VARMON
;; command. Enter the name of the symbol that you wish
;; to monitor. Issue the VARMON command a second time
;; to disable monitoring.
;;
;; When monitoring is enabled, at the end of each command or other
;; operation, at the point where AutoCAD returns to the Command:
;; prompt, the monitored symbol's current value is compared to the
;; value it had when the operation or command started. if the value
;; has changed, a message will appear on the console alerting you 
;; to the change, along with the previous and current values of the 
;; symbol. When the alert appears, whatever command or operation it
;; was that had just ended is the likely source of the change. 
;;
;; However, it is also possible that reactor callbacks could have a 
;; role as well, but VARMON cannot monitor reactor callbacks.
;;
;; Note: VARMON monitors the value of symbols in the namespace 
;; of the active document.


(vl-load-com)
(vl-load-reactors)


(if (and *varmon-reactor* (vlr-added-p *varmon-reactor*))
   (vlr-remove *varmon-reactor*)
)

(if (not *varmon-reactor*)
   (progn
      (setq *varmon-reactor*
         (vlr-docmanager-reactor nil
           '((:vlr-documentLockModeChanged . varmon-LockModeChanged))
         )
      )
      (vlr-remove *varmon-reactor*)
   )
)


(setq *varmon-symbol* nil)
(setq *varmon-value* nil)

(defun C:VARMON ( / name sym)
   (if (not (vlr-added-p *varmon-reactor*))
      (if (setq sym (getsymbol (getstr "\nSymbol to monitor" (GetSymbolName))))
         (varmon sym)
      )
      (varmon nil)
   )
   (princ)
)

;;; Non-interative back-end, intended to be used
;;; from a .LSP file that's loaded at startup.
;;;
;;; Use (varmon 'varname) to enable monitoring of
;;; the given symbol. The symbol must be quoted.
;;;
;;; Use (varmon nil) to disable monitoring

(defun varmon (sym)
   (if (vlr-added-p *varmon-reactor*)
      (vlr-remove *varmon-reactor*)
   )
   (if sym 
      (progn
         (vlr-add *varmon-reactor*)
         (setq *varmon-symbol* sym)
         (setq *varmon-value* (eval *varmon-symbol*))
         (princ 
            (strcat 
               "\nVariable monitor enabled,\nMonitoring symbol: " 
               (vl-symbol-name *varmon-symbol*)
               "\nCurrent value of " (vl-symbol-name *varmon-symbol*) ": "
               (vl-prin1-to-string *varmon-value*)
            )
         )
      )
      (princ "\nVariable monitor disabled.")
   )
   (princ)
) 

(defun GetSymbolName()
   (if *varmon-symbol*
      (vl-symbol-name *varmon-symbol*)
   )
)

(defun GetSymbol (str / expr)
   (if (/= str "")
      (progn
         (setq expr (vl-catch-all-apply 'read (list str)))
         (if (and (not (vl-catch-all-error-p expr))
                  (eq (type expr) 'sym)
             )
             expr
         )
      )
   )
)
      

(defun getstr (promptstr default / ps res)
   (setq res
      (getstring
         (strcat promptstr 
            (if default
               (strcat " <" default ">: ")
               ": "
            )
         )
      )
   )
   (cond ((and res (not (eq res ""))) res) (t default))
)

            
(defun varmon-LockModeChanged (reactor args / newval oldval cmd)
   (if (and (eq :vlax-true (vla-get-active (car args)))
            (eq "#" (substr (setq cmd (last args)) 1 1))
       )
      (progn
         (setq newval (eval *varmon-symbol*))
         (if (not (equal newval *varmon-value*))
            (progn
               (setq oldval *varmon-value*)
               (setq *varmon-value* newval)
               (princ 
                  (strcat 
                     "\n*** VARMON: Value of symbol " 
                     (vl-symbol-name *varmon-symbol*)
                     " changed after "
                     (substr cmd 2)
                     " ***\n  Old value: "
                     (vl-prin1-to-string oldval)
                     "\n  New value: "
                     (vl-prin1-to-string *varmon-value*)
                     "\n"
                  )
               )
               (textscr)
            )
         )
      )
   )
)

(princ "\nVARMON.LSP loaded, use VARMON command to enable variable monitoring")
(princ)

 

0 Likes
Message 43 of 44

MP07
Contributor
Contributor

This is EXTREMELY annoying, on a fresh windows installation(7 days old) and therefore autocad as well, now the problem arised !!!

Whoever solves this an easy way (not by completely reinstalling ofc) should be given the Nobel prize!

God **** it!

0 Likes
Message 44 of 44

DannyNL
Advisor
Advisor

And since it is a fresh installation, I assume you did try the (VL-LOAD-COM) first before using any other VL* commands since Visual LISP isn't loaded by default?

0 Likes