• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

errore lisp: no function definition: vlax-ename-gsvla-object

  • Thread starter Thread starter Berior
  • Start date Start date

Berior

Guest
Hello everyone,
today my 2015 autocad (I have windows 8.1 to 64bit) woke up typing the custom command sup returned this error:
no function definition: vlax-ename->vla-object

And yet I haven't made any changes anywhere. today I updated the video card... but I don't think you can interface with autocad until you recognize the command... this command automatically loads when autocad starts.
This is the lsp script, can you tell me what's wrong?
(defun c:sup (/ lay cms pt int block)
(vl-load-com)
;;(defun sup error(s)
;; (if (/= s "function cancelled")
;; (princ (strcated "\nerror: "s)))
;;; )
;; (if olderr (setq *error* olderr)
;;;(princ)
;;; )
(setq cmd (getvar "cmdecho")
lay(vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "sup")
)
(vla-put-color lay 6)
(setvar "cmdecho" 0)
(setq pt (getpoint "tocca un punto interno all'area."))
(vl-cmdf "_bpoly" pt "")
(setq ent (entlast)
block (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)) (vlax-3d-point pt) "area_by" 1 1 1 0)
)
(vla-put-textstring (car (safearray-value (variant-value)))(rtos (vla-get-area (vlax-ename->vla-object ent))) 2 2))
(vla-put-textstring (cadr (safearray-value))(rtos (vla-getattributes block)))(vla-get-length (vlax-ename->vla-object ent)))2 2))
(vla-put-layer block "sup")
(setvar "cmdecho" cmd)
(princ)
)
 
No, the section is right.
try reinstalling autocad or (if you're in a hurry) and you want to put a 'weet' instead of using vlax-ename->vla-object to get area and length of the pline use the humble function (command "_area" "_o" ent.... and then question the variables of system area and assumed with getvar.
 
I don't know where to put those commands in the lisp. I thought it was something like "Add this xxx string right after this yyy and it will work" ahuahu
 
ecco le modifiche:
. ...
(command "_area" "_o" ent)
(setq _ar(getvar"area") _pe(getvar"perimeter)
(vla-put-textstring (car (safearray-value))(rtos _ar 2 2))
(vla-put-textstring (cadr (safearray-value))(rtos _pe 2 2))
. ..
 
ecco le modifiche:
. ...
(command "_area" "_o" ent)
(setq _ar(getvar"area") _pe(getvar"perimeter)
(vla-put-textstring (car (safearray-value))(rtos _ar 2 2))
(vla-put-textstring (cadr (safearray-value))(rtos _pe 2 2))
. ..
Be it working. Thank you so much!
If it were to serve someone I attach the lisp.
the thread you can close
thanks to all
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top